changeset 23323:0800a4f84757

(underlying_strftime): Set the buffer to a nonzero value before calling strftime, and check to see whether strftime has set the buffer to zero. This lets us distinguish between an empty buffer and an error. I'm installing this patch by hand now; it will be superseded whenever the glibc sources are propagated back to fsf.org.
author Paul Eggert <eggert@twinsun.com>
date Fri, 25 Sep 1998 21:40:23 +0000
parents 26cc35857be5
children 4c5f12c6041c
files src/strftime.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/strftime.c	Fri Sep 25 20:30:42 1998 +0000
+++ b/src/strftime.c	Fri Sep 25 21:40:23 1998 +0000
@@ -742,8 +742,9 @@
 	      *u++ = modifier;
 	    *u++ = format_char;
 	    *u = '\0';
+	    ubuf[0] = '\1';
 	    len = strftime (ubuf, sizeof ubuf, ufmt, tp);
-	    if (len == 0)
+	    if (len == 0 && ubuf[0] != '\0')
 	      return 0;
 	    cpy (len, ubuf);
 	  }