From 9cf90923cade4da3e073ad4b560f4a50848e659e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 6 Dec 2000 22:09:46 +0000 Subject: [PATCH] Update. 2000-12-06 Jim Wilson * stdlib/l64a.c (l64a): Truncate m to 32-bit value. --- ChangeLog | 4 ++++ stdlib/l64a.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e27fed..2d3b520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-12-06 Jim Wilson + + * stdlib/l64a.c (l64a): Truncate m to 32-bit value. + 2000-12-06 Ulrich Drepper * stdio-common/printf_fp.c (__printf_fp): Handle decimal point in diff --git a/stdlib/l64a.c b/stdlib/l64a.c index 9fbde5d..b9922b0 100644 --- a/stdlib/l64a.c +++ b/stdlib/l64a.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -40,13 +40,16 @@ l64a (n) static char result[7]; int cnt; - if (m == 0l) + /* The standard says that only 32 bits are used. */ + m &= 0xffffffff; + + if (m == 0ul) /* The value for N == 0 is defined to be the empty string. */ return (char *) ""; result[6] = '\0'; - for (cnt = 5; m > 0; --cnt) + for (cnt = 5; m > 0ul; --cnt) { result[cnt] = conv_table[m & 0x3f]; m >>= 6; -- 2.7.4