summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/regex/regerror.c')
-rw-r--r--lib/libc/regex/regerror.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c
index 23915915a5b..a5c26f60122 100644
--- a/lib/libc/regex/regerror.c
+++ b/lib/libc/regex/regerror.c
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
#else
-static char rcsid[] = "$OpenBSD: regerror.c,v 1.5 1998/03/19 00:30:10 millert Exp $";
+static char rcsid[] = "$OpenBSD: regerror.c,v 1.6 2001/06/27 00:58:55 lebel Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -149,8 +149,7 @@ size_t errbuf_size;
len = strlen(s) + 1;
if (errbuf_size > 0) {
- (void) strncpy(errbuf, s, errbuf_size-1);
- errbuf[errbuf_size-1] = '\0';
+ strlcpy(errbuf, s, errbuf_size);
}
return(len);