diff --git a/abstract-machine/klib/src/printf.c b/abstract-machine/klib/src/printf.c index 788b916..88847a0 100644 --- a/abstract-machine/klib/src/printf.c +++ b/abstract-machine/klib/src/printf.c @@ -27,7 +27,8 @@ int num_to_ascii(int num, int power, int size, char *buf) { return ret; } -static inline int print_fmt(char **out, int n, const char** fmt, va_list ap) { +static inline int print_fmt(char **out, int n, const char** fmt, void* _ap) { + va_list ap = *(va_list*)_ap; int ret = 0; switch (**fmt) { case 'd': @@ -67,7 +68,7 @@ int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) { if (*fmt == '%') { // FIXME fmt++; - print_fmt(&out, 123, &fmt, ap); + print_fmt(&out, 123, &fmt, &ap); continue; } *out = *fmt;