openbsd-ports/www/junkbuster/patches/patch-gnu_regex_c
2001-06-09 03:13:18 +00:00

21 lines
577 B
Plaintext

$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
+++ 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);
- errbuf[errbuf_size - 1] = 0;
- }
- else
- strcpy (errbuf, msg);
- }
+ strlcpy (errbuf, msg, errbuf_size);
return msg_size;
}