1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 13:33:52 +01:00

Set the first character of buf to '\1' before the strftime() call so

we can try to distinguish a zero-length string from an error return
(a minor fix to Peter's patch).
This commit is contained in:
Wayne Davison 2004-05-05 17:00:58 +00:00
parent f57f65282b
commit c42420319f

@ -1834,7 +1834,7 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
* Remember we've already allowed for two characters
* in the accounting in bufsize (but nowhere else).
*/
*buf = '\0';
*buf = '\1';
tmp[1] = fmt[-1];
if (!strftime(buf, bufsize + 2, tmp, tm))
{