summaryrefslogtreecommitdiff
path: root/userland/test
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-06-26 01:41:28 +0200
committerAnton Kling <anton@kling.gg>2024-06-26 01:41:28 +0200
commit33e1b11555d3557a36bd69d63f5bf0c290b5d462 (patch)
tree7690db8310fc26f70b3cb96c8d2241969303cfe7 /userland/test
parent3bed68592da11f2d013f76534220275739dd7556 (diff)
LibC: Fix printf formatting
Previously %02x would not print out padding if the given value was zero.
Diffstat (limited to 'userland/test')
-rw-r--r--userland/test/test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/userland/test/test.c b/userland/test/test.c
index 9013f1e..29aa34c 100644
--- a/userland/test/test.c
+++ b/userland/test/test.c
@@ -578,6 +578,8 @@ void printf_test(void) {
EXP("hex: 1");
buf_n = sprintf(buf, "hex: %x", 0x622933f2);
EXP("hex: 622933f2");
+ buf_n = sprintf(buf, "hex: %02x", 0);
+ EXP("hex: 00");
buf_n = sprintf(buf, "oct: %02o", 1);
EXP("oct: 01");