diff options
Diffstat (limited to 'lib/io/io.c')
| -rw-r--r-- | lib/io/io.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/io/io.c b/lib/io/io.c index 3b0ea96..43e05b4 100644 --- a/lib/io/io.c +++ b/lib/io/io.c @@ -23,6 +23,8 @@ void rstd(char *buf, unsigned long count) void wstdf__(const char *buf, const void **args) { const char *start = buf; + char stoi_buf[32] = ""; + int i; for (; *buf; ++buf) { if (*buf == '%') { if (buf - start > 0) @@ -36,6 +38,18 @@ void wstdf__(const char *buf, const void **args) __wstdn(((const char **)args)[0], cstr_length(((const char**)args)[0])); ++args; break; + case 'i': + for (i = 0; i < 32; ++i) + stoi_buf[i] = 0; + i64_to_cstr(((u64 *)args)[0], stoi_buf, 32); + __wstdn(stoi_buf, cstr_length(stoi_buf)); + break; + case 'u': + for (i = 0; i < 32; ++i) + stoi_buf[i] = 0; + u64_to_cstr(((u64 *)args)[0], stoi_buf, 32); + __wstdn(stoi_buf, cstr_length(stoi_buf)); + break; case 'S': sgr(((const char **)args)[0]); ++args; |