Handle empty format string in printf(1)
This commit is contained in:
parent
5c8a9b375f
commit
dc3a2ffc4a
3
printf.c
3
printf.c
|
@ -32,7 +32,8 @@ int main(int argc, char *argv[])
|
||||||
cooldown = 1;
|
cooldown = 1;
|
||||||
}
|
}
|
||||||
formatlen = unescape(format);
|
formatlen = unescape(format);
|
||||||
|
if (formatlen == 0)
|
||||||
|
return 0;
|
||||||
lastargi = 0;
|
lastargi = 0;
|
||||||
for (i = 0, argi = 2; !cooldown || i < formatlen; i++, i = cooldown ? i : (i % formatlen)) {
|
for (i = 0, argi = 2; !cooldown || i < formatlen; i++, i = cooldown ? i : (i % formatlen)) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user