Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/historical/nawk/dist PR/50199 - fix for strftime ca...



details:   https://anonhg.NetBSD.org/src/rev/6182a854d644
branches:  trunk
changeset: 341384:6182a854d644
user:      shm <shm%NetBSD.org@localhost>
date:      Tue Nov 03 14:15:08 2015 +0000

description:
PR/50199 - fix for strftime called with empty string.
Patch written by Juho Salminen

diffstat:

 external/historical/nawk/dist/run.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 2a6cf5871110 -r 6182a854d644 external/historical/nawk/dist/run.c
--- a/external/historical/nawk/dist/run.c       Tue Nov 03 11:14:05 2015 +0000
+++ b/external/historical/nawk/dist/run.c       Tue Nov 03 14:15:08 2015 +0000
@@ -1660,7 +1660,7 @@
                do {
                        if ((buf = realloc(buf, (sz *= 2))) == NULL)
                                FATAL("out of memory in strftime");
-               } while(strftime(buf, sz, fmt, tm) == 0);
+               } while(strftime(buf, sz, fmt, tm) == 0 && fmt[0] != '\0');
 
                y = gettemp();
                setsval(y, buf);



Home | Main Index | Thread Index | Old Index