Module Name:    src
Committed By:   shm
Date:           Tue Nov  3 14:15:08 UTC 2015

Modified Files:
        src/external/historical/nawk/dist: run.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/historical/nawk/dist/run.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/historical/nawk/dist/run.c
diff -u src/external/historical/nawk/dist/run.c:1.8 src/external/historical/nawk/dist/run.c:1.9
--- src/external/historical/nawk/dist/run.c:1.8	Sun Dec 15 06:41:18 2013
+++ src/external/historical/nawk/dist/run.c	Tue Nov  3 14:15:08 2015
@@ -1660,7 +1660,7 @@ Cell *bltin(Node **a, int n)	/* builtin 
 		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);

Reply via email to