diff options
| author | itojun <itojun@NetBSD.org> | 2002-11-17 01:51:24 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 2002-11-17 01:51:24 +0000 |
| commit | 9134efabd0bc1675980c615bb79204975d2fe800 (patch) | |
| tree | 90a993b59ae614f65c80307bf6365b765c50b681 /lib/libc/string | |
| parent | 66578bbe09f0967561c34e2871a83548398f1621 (diff) | |
use strlcpy where it is more appropriate.
Diffstat (limited to 'lib/libc/string')
| -rw-r--r-- | lib/libc/string/__strerror.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/string/__strerror.c b/lib/libc/string/__strerror.c index 48d42ccb5b0..1186192c845 100644 --- a/lib/libc/string/__strerror.c +++ b/lib/libc/string/__strerror.c @@ -1,4 +1,4 @@ -/* $NetBSD: __strerror.c,v 1.19 2002/11/11 01:12:04 thorpej Exp $ */ +/* $NetBSD: __strerror.c,v 1.20 2002/11/17 01:51:25 itojun Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -38,7 +38,7 @@ #if 0 static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91"; #else -__RCSID("$NetBSD: __strerror.c,v 1.19 2002/11/11 01:12:04 thorpej Exp $"); +__RCSID("$NetBSD: __strerror.c,v 1.20 2002/11/17 01:51:25 itojun Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -79,9 +79,8 @@ __strerror(num, buf, buflen) errnum = num; /* convert to unsigned */ if (errnum < (unsigned int) sys_nerr) { #ifdef NLS - (void)strncpy(buf, catgets(catd, 1, (int)errnum, + (void)strlcpy(buf, catgets(catd, 1, (int)errnum, sys_errlist[errnum]), buflen); - buf[buflen - 1] = '\0'; #else return(sys_errlist[errnum]); #endif |
