From ab1c32a6981e6742cb6c463c01ff59680c2ac773 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 25 Oct 2001 10:20:40 +0000 Subject: * 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. --- stdlib/a64l.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'stdlib/a64l.c') 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); -- cgit v1.2.3