commit dc3a2ffc4ad9e97fc63d432ee860584339c01ee8
parent 5c8a9b375f338c27353f272ba37a62b82822fc33
Author: FRIGN <dev@frign.de>
Date: Sun, 15 Feb 2015 15:20:32 +0100
Handle empty format string in printf(1)
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/printf.c b/printf.c
@@ -32,7 +32,8 @@ int main(int argc, char *argv[])
cooldown = 1;
}
formatlen = unescape(format);
-
+ if (formatlen == 0)
+ return 0;
lastargi = 0;
for (i = 0, argi = 2; !cooldown || i < formatlen; i++, i = cooldown ? i : (i % formatlen)) {
if (i == 0) {