From 3f79b7bd553a52fca7a098f5195b406ff9970491 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sun, 15 Jan 2023 01:13:51 +0100 Subject: add list and static library builder --- lib/io/io.c | 14 ++++++++++++++ lib/io/test | Bin 26504 -> 0 bytes 2 files changed, 14 insertions(+) delete mode 100755 lib/io/test (limited to 'lib/io') 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 deleted file mode 100755 index b2a3047..0000000 Binary files a/lib/io/test and /dev/null differ -- cgit v1.2.3-70-g09d2