about summary refs log tree commit diff
path: root/stdlib/a64l.c
diff options
context:
space:
mode:
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);