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/l64a.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'stdlib/l64a.c') diff --git a/stdlib/l64a.c b/stdlib/l64a.c index 958f8a0..f3a249f 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; } -- cgit v1.1