mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 06:20:55 +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:
parent
f57f65282b
commit
c42420319f
1 changed files with 1 additions and 1 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue