diff options
Diffstat (limited to 'regex')
-rw-r--r-- | regex/regerror.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/regex/regerror.c b/regex/regerror.c index 12edd4e164..319f116896 100644 --- a/regex/regerror.c +++ b/regex/regerror.c @@ -94,8 +94,7 @@ size_t errbuf_size; if (errbuf_size > len) (void) strcpy(errbuf, s); else { - (void) strncpy(errbuf, s, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; + (void) strlcpy(errbuf, s, errbuf_size); } } |