2001-06-08 23:13:18 -04:00
|
|
|
$OpenBSD: patch-gnu_regex_c,v 1.3 2001/06/09 03:13:18 angelos Exp $
|
2001-04-19 11:46:33 -04:00
|
|
|
--- gnu_regex.c.orig Fri Oct 30 22:58:47 1998
|
2001-06-08 23:13:18 -04:00
|
|
|
+++ gnu_regex.c Fri Jun 8 23:11:28 2001
|
|
|
|
@@ -4909,15 +4909,7 @@ regerror (errcode, preg, errbuf, errbuf_
|
|
|
|
msg_size = strlen (msg) + 1; /* Includes the null. */
|
|
|
|
|
|
|
|
if (errbuf_size != 0)
|
|
|
|
- {
|
|
|
|
- if (msg_size > errbuf_size)
|
|
|
|
- {
|
2001-06-08 22:36:48 -04:00
|
|
|
- strncpy (errbuf, msg, errbuf_size - 1);
|
2001-06-08 23:13:18 -04:00
|
|
|
- errbuf[errbuf_size - 1] = 0;
|
|
|
|
- }
|
|
|
|
- else
|
2001-04-19 11:46:33 -04:00
|
|
|
- strcpy (errbuf, msg);
|
2001-06-08 23:13:18 -04:00
|
|
|
- }
|
|
|
|
+ strlcpy (errbuf, msg, errbuf_size);
|
2001-04-19 11:46:33 -04:00
|
|
|
|
|
|
|
return msg_size;
|
2001-06-08 23:13:18 -04:00
|
|
|
}
|