diff options
Diffstat (limited to 'pk')
-rw-r--r-- | pk/console.c | 9 | ||||
-rw-r--r-- | pk/mtrap.c | 7 |
2 files changed, 9 insertions, 7 deletions
diff --git a/pk/console.c b/pk/console.c index a9258fc..097842b 100644 --- a/pk/console.c +++ b/pk/console.c @@ -56,9 +56,12 @@ int vsnprintf(char* out, size_t n, const char* s, va_list vl) } case 's': { - const char* s2 = va_arg(vl,const char*); - while(*s2) - if (++pos < n) out[pos-1] = *s2++; + const char* s2 = va_arg(vl, const char*); + while (*s2) { + if (++pos < n) + out[pos-1] = *s2; + s2++; + } longarg = false; format = false; break; @@ -133,16 +133,15 @@ static uintptr_t mcall_htif_syscall(uintptr_t magic_mem) void printm(const char* s, ...) { - char buf[128]; + char buf[256]; va_list vl; va_start(vl, s); vsnprintf(buf, sizeof buf, s, vl); va_end(vl); - char* p = buf; - while (*p) - mcall_console_putchar(*p++); + for (const char* p = buf; *p; p++) + mcall_console_putchar(*p); } static void send_ipi(uintptr_t recipient, int event) |