diff options
Diffstat (limited to 'lib/io')
| -rw-r--r-- | lib/io/io.c | 14 | ||||
| -rwxr-xr-x | lib/io/test | bin | 26504 -> 0 bytes |
2 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; diff --git a/lib/io/test b/lib/io/test Binary files differdeleted file mode 100755 index b2a3047..0000000 --- a/lib/io/test +++ /dev/null |