From 8a261abefde3eb7c4a3ecb94acbb4b500b8cd1aa Mon Sep 17 00:00:00 2001 From: millert <> Date: Sun, 17 Aug 1997 22:58:34 +0000 Subject: Man page for a64l(3) and l64a(3), based on a64l.3 from the MiNT docs 0.1. Also make a64l(3) and l64a(3) deal reasonably with inapropriate input. The standard does not require this, but it does not disallow it either. --- src/lib/libc/stdlib/l64a.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lib/libc/stdlib/l64a.c') diff --git a/src/lib/libc/stdlib/l64a.c b/src/lib/libc/stdlib/l64a.c index 630f9e3365..4e99391254 100644 --- a/src/lib/libc/stdlib/l64a.c +++ b/src/lib/libc/stdlib/l64a.c @@ -4,13 +4,14 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: l64a.c,v 1.2 1996/08/19 08:33:33 tholo Exp $"; +static char *rcsid = "$OpenBSD: l64a.c,v 1.3 1997/08/17 22:58:34 millert Exp $"; #endif /* LIBC_SCCS and not lint */ +#include #include char * -l64a (value) +l64a(value) long value; { static char buf[8]; @@ -18,8 +19,10 @@ l64a (value) int digit; int i; - if (!value) - return NULL; + if (value < 0) { + errno = EINVAL; + return(NULL); + } for (i = 0; value != 0 && i < 6; i++) { digit = value & 0x3f; @@ -39,5 +42,5 @@ l64a (value) *s = '\0'; - return buf; + return(buf); } -- cgit v1.2.3-55-g6feb