diff options
Diffstat (limited to 'usr.sbin/bind/lib/isc/unix')
-rw-r--r-- | usr.sbin/bind/lib/isc/unix/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/file.c b/usr.sbin/bind/lib/isc/unix/file.c index 95f5428ca43..f6e80e7fa7e 100644 --- a/usr.sbin/bind/lib/isc/unix/file.c +++ b/usr.sbin/bind/lib/isc/unix/file.c @@ -145,8 +145,7 @@ isc_file_template(const char *path, const char *templet, char *buf, if ((s - path + 1 + strlen(templet) + 1) > buflen) return (ISC_R_NOSPACE); - strncpy(buf, path, s - path + 1); - buf[s - path + 1] = '\0'; + strlcpy(buf, path, buflen); strlcat(buf, templet, buflen); } else { if ((strlen(templet) + 1) > buflen) |