summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-12-09 14:58:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-12-09 14:58:36 +0000
commit6e58a1df8faab311a0479ef630b891ef50fd3f14 (patch)
treed5c9e2b34b23ea10d6bba734c6332f6ee5bd5a89 /Src/utils.c
parent0eed895796ee98a5733f4dcb8cf8297ea805a99c (diff)
downloadzsh-6e58a1df8faab311a0479ef630b891ef50fd3f14.tar.gz
zsh-6e58a1df8faab311a0479ef630b891ef50fd3f14.tar.xz
zsh-6e58a1df8faab311a0479ef630b891ef50fd3f14.zip
24197: interface to ztrftime() for insufficient memory was broken
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Src/utils.c b/Src/utils.c
index d776d7cb3..8a58c5ea8 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2389,7 +2389,7 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
 	     * Fix up some longer cases specially when we get to them.
 	     */
 	    if (ztrftimebuf(&bufsize, 2))
-		return 0;
+		return -1;
 	    switch (*fmt++) {
 	    case 'd':
 		*buf++ = '0' + tm->tm_mday / 10;
@@ -2447,12 +2447,12 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
 #ifndef HAVE_STRFTIME
 	    case 'a':
 		if (ztrftimebuf(&bufsize, strlen(astr[tm->tm_wday]) - 2))
-		    return 0;
+		    return -1;
 		strucpy(&buf, astr[tm->tm_wday]);
 		break;
 	    case 'b':
 		if (ztrftimebuf(&bufsize, strlen(estr[tm->tm_mon]) - 2))
-		    return 0;
+		    return -1;
 		strucpy(&buf, estr[tm->tm_mon]);
 		break;
 	    case 'p':
@@ -2487,7 +2487,7 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
 	    }
 	} else {
 	    if (ztrftimebuf(&bufsize, 1))
-		return 0;
+		return -1;
 	    *buf++ = *fmt++;
 	}
     *buf = '\0';