21 lines
580 B
Plaintext
21 lines
580 B
Plaintext
$OpenBSD: patch-gnu_regex_c,v 1.4 2010/05/24 22:17:03 espie Exp $
|
|
--- gnu_regex.c.orig Sat Oct 31 04:58:47 1998
|
|
+++ gnu_regex.c Sat May 22 16:47:47 2010
|
|
@@ -4909,15 +4909,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
|
msg_size = strlen (msg) + 1; /* Includes the null. */
|
|
|
|
if (errbuf_size != 0)
|
|
- {
|
|
- if (msg_size > errbuf_size)
|
|
- {
|
|
- strncpy (errbuf, msg, errbuf_size - 1);
|
|
- errbuf[errbuf_size - 1] = 0;
|
|
- }
|
|
- else
|
|
- strcpy (errbuf, msg);
|
|
- }
|
|
+ strlcpy (errbuf, msg, errbuf_size);
|
|
|
|
return msg_size;
|
|
}
|