fix snprintf "%#.0o" test
authorSzabolcs Nagy <nsz@port70.net>
Tue, 6 Jan 2015 15:59:01 +0000 (16:59 +0100)
committerSzabolcs Nagy <nsz@port70.net>
Tue, 6 Jan 2015 15:59:01 +0000 (16:59 +0100)
see musl commit b91cdbe2bc8b626aa04dc6e3e84345accf34e4b1

src/functional/snprintf.c

index 600cd11..c96f151 100644 (file)
@@ -36,11 +36,11 @@ static const struct {
        { "%0-5d", 12, "12   " },
        { "%-05d", 12, "12   " },
 
-       /* ...explicit precision of 0 shall be no characters. */
+       /* ...explicit precision of 0 shall be no characters except for alt-octal. */
        { "%.0d", 0, "" },
        { "%.0o", 0, "" },
        { "%#.0d", 0, "" },
-       { "%#.0o", 0, "" },
+       { "%#.0o", 0, "0" },
        { "%#.0x", 0, "" },
 
        /* ...but it still has to honor width and flags. */