From: Rich Felker Date: Wed, 7 Feb 2018 21:26:17 +0000 (+0000) Subject: add octal corner cases X-Git-Url: http://nsz.repo.hu/git/?p=libc-test;a=commitdiff_plain;h=7454819aa30c0a52b8b99f857eeba410ff7d3c51 add octal corner cases --- diff --git a/src/functional/snprintf.c b/src/functional/snprintf.c index c96f151..70c1118 100644 --- a/src/functional/snprintf.c +++ b/src/functional/snprintf.c @@ -60,6 +60,20 @@ static const struct { { "%o", 15, "17" }, { "%#o", 15, "017" }, + /* octal: corner cases */ + { "%#o", 0, "0" }, + { "%#.0o", 0, "0" }, + { "%#.1o", 0, "0" }, + { "%#o", 1, "01" }, + { "%#.0o", 1, "01" }, + { "%#.1o", 1, "01" }, + { "%#04o", 1, "0001" }, + { "%#04.0o", 1, " 01" }, + { "%#04.1o", 1, " 01" }, + { "%04o", 1, "0001" }, + { "%04.0o", 1, " 1" }, + { "%04.1o", 1, " 1" }, + { NULL, 0.0, NULL } };