summary refs log tree commit diff
path: root/time/strftime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-24 15:02:06 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-24 15:02:06 +0000
commit3465c0ce37f534b4b1b9fa6cfd07fb3e88e2dcc0 (patch)
tree2716bd6e0003436f883a7fafa20f19413556972d /time/strftime.c
parent7a3bfc4ef45ec886010b63ba6ba4a7029b1cd526 (diff)
downloadglibc-3465c0ce37f534b4b1b9fa6cfd07fb3e88e2dcc0.tar.gz
glibc-3465c0ce37f534b4b1b9fa6cfd07fb3e88e2dcc0.tar.xz
glibc-3465c0ce37f534b4b1b9fa6cfd07fb3e88e2dcc0.zip
Update.
1998-09-24  Paul Eggert  <eggert@twinsun.com>

	* strftime.c (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.

1998-09-24  Paul Eggert  <eggert@shade.twinsun.com>

	* strftime.c (INT_STRLEN_BOUND): Fix typo by changing 100 to 1000.
	This fix is propagated from tzcode1998g.tar.gz.
Diffstat (limited to 'time/strftime.c')
-rw-r--r--time/strftime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/time/strftime.c b/time/strftime.c
index 0a830b0588..61f688e1b2 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -134,7 +134,7 @@ extern char *tzname[];
    add one for integer division truncation;
    add one more for a minus sign if t is signed.  */
 #define INT_STRLEN_BOUND(t) \
-  ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 100 + 1 + TYPE_SIGNED (t))
+ ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
 
 #define TM_YEAR_BASE 1900
 
@@ -748,7 +748,7 @@ my_strftime (s, maxsize, format, tp)
 	    *u++ = format_char;
 	    *u = '\0';
 	    len = strftime (ubuf, sizeof ubuf, ufmt, tp);
-	    if (len == 0)
+	    if (len == 0 && ubuf[0] != '\0')
 	      return 0;
 	    cpy (len, ubuf);
 	  }