All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m46s
30 lines
518 B
C
30 lines
518 B
C
#include "mprintf.h"
|
|
#include "self.h"
|
|
#include <liballoc.h>
|
|
#include <printf.h>
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <system.h>
|
|
|
|
void putchar_ (char ch) { (void)ch; }
|
|
|
|
void mprintf (const char* fmt, ...) {
|
|
va_list args;
|
|
va_start (args, fmt);
|
|
|
|
char* buf = malloc (MPRINTF_BUF_MAX);
|
|
|
|
if (buf == NULL) {
|
|
va_end (args);
|
|
return;
|
|
}
|
|
|
|
memset (buf, 0, MPRINTF_BUF_MAX);
|
|
int len = vsnprintf (buf, MPRINTF_BUF_MAX, fmt, args);
|
|
|
|
va_end (args);
|
|
|
|
mail_send (e_pgid, buf, len);
|
|
free (buf);
|
|
}
|