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