openbsd-ports/www/junkbuster/patches/patch-gnu_regex_c

21 lines
577 B
Plaintext
Raw Normal View History

2001-06-08 23:13:18 -04:00
$OpenBSD: patch-gnu_regex_c,v 1.3 2001/06/09 03:13:18 angelos Exp $
--- 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)
- {
- strncpy (errbuf, msg, errbuf_size - 1);
2001-06-08 23:13:18 -04:00
- errbuf[errbuf_size - 1] = 0;
- }
- else
- strcpy (errbuf, msg);
2001-06-08 23:13:18 -04:00
- }
+ strlcpy (errbuf, msg, errbuf_size);
return msg_size;
2001-06-08 23:13:18 -04:00
}