about summary refs log tree commit diff
path: root/stdlib/l64a.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-06 22:09:46 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-06 22:09:46 +0000
commit9cf90923cade4da3e073ad4b560f4a50848e659e (patch)
tree69f74a5d9d18e22a6a59758e2f033665a9b91cf8 /stdlib/l64a.c
parent23a5c823a00a3fe593813e556faccceaebfa3efe (diff)
downloadglibc-9cf90923cade4da3e073ad4b560f4a50848e659e.tar.gz
glibc-9cf90923cade4da3e073ad4b560f4a50848e659e.tar.xz
glibc-9cf90923cade4da3e073ad4b560f4a50848e659e.zip
Update.
2000-12-06  Jim Wilson  <wilson@redhat.com>

	* stdlib/l64a.c (l64a): Truncate m to 32-bit value.
Diffstat (limited to 'stdlib/l64a.c')
-rw-r--r--stdlib/l64a.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/stdlib/l64a.c b/stdlib/l64a.c
index 9fbde5d139..b9922b091c 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 <drepper@gnu.ai.mit.edu>, 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;