glibc strftime.c INT_STRLEN_BOUND typo

Paul Eggert eggert@twinsun.com
Thu Sep 24 12:28:00 GMT 1998


A fix in tzcode1998g.tar.gz, today's tz release, prompted me to find a
similar problem in glibc 2.0.96 strftime.c.  The problem results in
some arrays being sized roughly 10 times too large.  Here is a patch.

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, released today.

--- strftime.c	1998/09/19 00:12:11	2.0.96.0
+++ strftime.c	1998/09/24 19:19:27	2.0.96.1
@@ -135,5 +135,5 @@ extern char *tzname[];
    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



More information about the Libc-alpha mailing list