PR/50199 - fix for strftime called with empty string.
Patch written by Juho Salminen
This commit is contained in:
parent
aa4d1a720b
commit
52ccb86d6c
2
external/historical/nawk/dist/run.c
vendored
2
external/historical/nawk/dist/run.c
vendored
@ -1660,7 +1660,7 @@ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg lis
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user