summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/l64a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/l64a.c')
-rw-r--r--src/lib/libc/stdlib/l64a.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/lib/libc/stdlib/l64a.c b/src/lib/libc/stdlib/l64a.c
deleted file mode 100644
index 4f33df37b2..0000000000
--- a/src/lib/libc/stdlib/l64a.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/* $OpenBSD: l64a.c,v 1.5 2005/08/08 08:05:36 espie Exp $ */
2/*
3 * Written by J.T. Conklin <jtc@netbsd.org>.
4 * Public domain.
5 */
6
7#include <errno.h>
8#include <stdlib.h>
9
10char *
11l64a(long value)
12{
13 static char buf[8];
14 char *s = buf;
15 int digit;
16 int i;
17
18 if (value < 0) {
19 errno = EINVAL;
20 return(NULL);
21 }
22
23 for (i = 0; value != 0 && i < 6; i++) {
24 digit = value & 0x3f;
25
26 if (digit < 2)
27 *s = digit + '.';
28 else if (digit < 12)
29 *s = digit + '0' - 2;
30 else if (digit < 38)
31 *s = digit + 'A' - 12;
32 else
33 *s = digit + 'a' - 38;
34
35 value >>= 6;
36 s++;
37 }
38
39 *s = '\0';
40
41 return(buf);
42}