diff --git a/abstract-machine/klib/src/printf.c b/abstract-machine/klib/src/printf.c index 07a4d15..788b916 100644 --- a/abstract-machine/klib/src/printf.c +++ b/abstract-machine/klib/src/printf.c @@ -27,15 +27,15 @@ 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, va_list ap) { int ret = 0; switch (**fmt) { case 'd': - ret = num_to_ascii(va_arg(*ap, int), 10, n, *out); + ret = num_to_ascii(va_arg(ap, int), 10, n, *out); (*out) += ret; break; case 's': - const char* str = va_arg(*ap, const char*); + const char* str = va_arg(ap, const char*); if (ret > n) break; for (; *str; str ++, (*out) ++, ret ++ ) { if (ret >= n) { @@ -45,13 +45,13 @@ static inline int print_fmt(char **out, int n, const char** fmt, va_list* ap) { } break; case 'c': - char ch = va_arg(*ap, int); + char ch = va_arg(ap, int); ret = 1; **out = ch; (*out) ++; break; case 'x': - ret = num_to_ascii(va_arg(*ap, int), 16, n, *out); + ret = num_to_ascii(va_arg(ap, int), 16, n, *out); (*out) += ret; break; default: @@ -61,7 +61,7 @@ static inline int print_fmt(char **out, int n, const char** fmt, va_list* ap) { return ret; } -int rvsnprintf(char* out, size_t n, const char* fmt, va_list* ap) { +int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap) { int ret = 0; while(*fmt && n) { if (*fmt == '%') { diff --git a/abstract-machine/klib/src/stdio.c b/abstract-machine/klib/src/stdio.c index 751c96b..8c8aaac 100644 --- a/abstract-machine/klib/src/stdio.c +++ b/abstract-machine/klib/src/stdio.c @@ -34,10 +34,10 @@ int snprintf(char *out, size_t n, const char *fmt, ...) { return ret; } -int rvsnprintf(char* out, size_t n, const char* fmt, va_list* ap); +int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap); int vsnprintf(char *out, size_t n, const char *fmt, va_list ap) { - return rvsnprintf(out, n, fmt, &ap); + return rvsnprintf(out, n, fmt, ap); } #endif