From 88a28a4cc3e139e5a30e0d9d121cbb3359acb1a6 Mon Sep 17 00:00:00 2001 From: tdeval Date: Sat, 5 Apr 2003 00:43:19 +0000 Subject: strcpy/strcat -> strlcpy/strlcat ok tedu@, hints by deraadt@ and millert@ --- lib/libc/regex/regcomp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libc/regex/regcomp.c') diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 10224be9240..fc01ad0bb4b 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94"; #else -static char rcsid[] = "$OpenBSD: regcomp.c,v 1.8 2002/02/16 21:27:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: regcomp.c,v 1.9 2003/04/05 00:43:20 tdeval Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -1285,8 +1285,7 @@ register char *cp; } cs->multis = np; - (void) strcpy(cs->multis + oldend - 1, cp); - cs->multis[cs->smultis - 1] = '\0'; + strlcpy(cs->multis + oldend - 1, cp, cs->smultis - oldend + 1); } /* -- cgit v1.2.3-59-g8ed1b