This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

glibc strftime.c INT_STRLEN_BOUND typo


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]