1 /* $NetBSD: l64a.c,v 1.13 2003/07/26 19:24:54 salo Exp $ */
4 * Written by J.T. Conklin <jtc@NetBSD.org>.
9 #if defined(LIBC_SCCS) && !defined(lint)
10 __RCSID("$NetBSD: l64a.c,v 1.13 2003/07/26 19:24:54 salo Exp $");
13 #include "namespace.h"
20 __weak_alias(l64a
,_l64a
)
21 __weak_alias(l64a_r
,_l64a_r
)
30 (void)l64a_r(value
, buf
, sizeof (buf
));
35 l64a_r (value
, buffer
, buflen
)
42 unsigned long v
= value
;
44 _DIAGASSERT(buffer
!= NULL
);
49 for (; v
!= 0 && buflen
> 1; s
++, buflen
--) {
50 digit
= (int)(v
& 0x3f);
57 *s
= digit
+ 'A' - 12;
59 *s
= digit
+ 'a' - 38;
66 return (v
== 0UL ? 0 : -1);