2 * Written by J.T. Conklin <jtc@NetBSD.org>.
5 * $NetBSD: l64a.c,v 1.13 2003/07/26 19:24:54 salo Exp $
6 * $FreeBSD: src/lib/libc/stdlib/l64a.c,v 1.1 2005/12/24 22:37:59 trhodes Exp $
16 l64a_r(value
, buf
, sizeof(buf
));
21 l64a_r(long value
, char *buffer
, int buflen
)
26 v
= value
& (long)0xffffffff;
27 for (; v
!= 0 && buflen
> 1; buffer
++, buflen
--) {
30 *buffer
= digit
+ '.';
32 *buffer
= digit
+ '0' - 2;
34 *buffer
= digit
+ 'A' - 12;
36 *buffer
= digit
+ 'a' - 38;
39 return (v
== 0 ? 0 : -1);