about summary refs log tree commit diff
path: root/stdlib/a64l.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2001-10-25 10:20:40 +0000
committerAndreas Schwab <schwab@suse.de>2001-10-25 10:20:40 +0000
commitab1c32a6981e6742cb6c463c01ff59680c2ac773 (patch)
tree98427b7a31aa21c0417f6eb6478bac416a1f3df7 /stdlib/a64l.c
parent412420ee838f53d5d9cda3cc270cb1b656cc7c13 (diff)
downloadglibc-ab1c32a6981e6742cb6c463c01ff59680c2ac773.tar.gz
glibc-ab1c32a6981e6742cb6c463c01ff59680c2ac773.tar.xz
glibc-ab1c32a6981e6742cb6c463c01ff59680c2ac773.zip
* stdlib/a64l.c: Expect least significant digit first.
* stdlib/l64a.c: Produce least significant digit first. 
* stdlib/Makefile (tests): Add test-a64l. 
* stdlib/test-a64l.c: New file.
Diffstat (limited to 'stdlib/a64l.c')
-rw-r--r--stdlib/a64l.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/stdlib/a64l.c b/stdlib/a64l.c
index 036e552f7f..23faf2744f 100644
--- a/stdlib/a64l.c
+++ b/stdlib/a64l.c
@@ -43,6 +43,7 @@ a64l (string)
   const char *ptr = string;
   unsigned long int result = 0ul;
   const char *end = ptr + 6;
+  int shift = 0;
 
   do
     {
@@ -55,9 +56,9 @@ a64l (string)
       value = (int) a64l_table[index];
       if (value == (int) XX)
 	break;
-      result <<= 6;
       ++ptr;
-      result |= value;
+      result |= value << shift;
+      shift += 6;
     }
   while (ptr != end);