summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/l64a.c
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2023-07-15 19:29:46 +0000
committercvs2svn <admin@example.com>2023-07-15 19:29:46 +0000
commit72cc860132e5b7971e495ba621dcd0713b5dd801 (patch)
treeeb2977d6a31db45cc5481c643fa2a77238fa93bb /src/lib/libc/stdlib/l64a.c
parent0d87a20f1d7f7c6ae9a6cbb5bc3c2235ee3fe18a (diff)
downloadopenbsd-tb_20230715.tar.gz
openbsd-tb_20230715.tar.bz2
openbsd-tb_20230715.zip
This commit was manufactured by cvs2git to create tag 'tb_20230715'.tb_20230715
Diffstat (limited to '')
-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}