Handle empty format string in printf(1)

This commit is contained in:
FRIGN 2015-02-15 15:20:32 +01:00
parent 5c8a9b375f
commit dc3a2ffc4a
1 changed files with 2 additions and 1 deletions

View File

@ -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) {