[hackers] [sbase] Handle empty format string in printf(1) || FRIGN

From: <git_AT_suckless.org>
Date: Tue, 24 Mar 2015 23:53:49 +0100 (CET)

commit dc3a2ffc4ad9e97fc63d432ee860584339c01ee8
Author: FRIGN <dev_AT_frign.de>
Date: Sun Feb 15 15:20:32 2015 +0100

    Handle empty format string in printf(1)

diff --git a/printf.c b/printf.c
index bfd8670..ec5d441 100644
--- a/printf.c
+++ b/printf.c
_AT_@ -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) {
Received on Tue Mar 24 2015 - 23:53:49 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 25 2015 - 00:10:16 CET