summary refs log tree commit diff
path: root/stdlib/l64a.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/l64a.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/l64a.c')
-rw-r--r--stdlib/l64a.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/stdlib/l64a.c b/stdlib/l64a.c
index 958f8a09ee..f3a249fedf 100644
--- a/stdlib/l64a.c
+++ b/stdlib/l64a.c
@@ -47,13 +47,12 @@ l64a (n)
     /* The value for N == 0 is defined to be the empty string. */
     return (char *) "";
 
-  result[6] = '\0';
-
-  for (cnt = 5; m > 0ul; --cnt)
+  for (cnt = 0; m > 0ul; ++cnt)
     {
       result[cnt] = conv_table[m & 0x3f];
       m >>= 6;
     }
+  result[cnt] = '\0';
 
-  return &result[cnt + 1];
+  return result;
 }