summaryrefslogtreecommitdiff
path: root/src/user/app
diff options
context:
space:
mode:
authordzwdz2022-09-15 22:43:39 +0200
committerdzwdz2022-09-15 22:43:39 +0200
commit6c7c19e4378b9b9640dc0b250d09264f5cd99572 (patch)
treec8bd8738cc9429becc18b263d3bd21cc4f7247ff /src/user/app
parent9cf3079b95ad7e995880ec5553372191c73efb0e (diff)
shared/printf: string precision
Diffstat (limited to 'src/user/app')
-rw-r--r--src/user/app/tests/shared/printf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/user/app/tests/shared/printf.c b/src/user/app/tests/shared/printf.c
index 37b9679..71122f5 100644
--- a/src/user/app/tests/shared/printf.c
+++ b/src/user/app/tests/shared/printf.c
@@ -43,6 +43,9 @@ static void test_printf(void) {
test(!strcmp(buf, " -001"));
snprintf(buf, sizeof buf, "%.5d", 123);
test(!strcmp(buf, "00123"));
+
+ snprintf(buf, sizeof buf, "%.1s,%.10s,%.*s", "hello", "hello", 3, "hello");
+ test(!strcmp(buf, "h,hello,hel"));
}
void r_s_printf(void) {