diff options
| author | 2003-06-27 19:08:22 +0000 | |
|---|---|---|
| committer | 2003-06-27 19:08:22 +0000 | |
| commit | 44c5f86991d56e224338eb71979bd544d0147a1c (patch) | |
| tree | 22fdcdd89735d8b7d3b44281e8beec96481ae936 /usr.sbin/bind/lib/isc/mem.c | |
| parent | protos for userland build (diff) | |
| download | wireguard-openbsd-44c5f86991d56e224338eb71979bd544d0147a1c.tar.xz wireguard-openbsd-44c5f86991d56e224338eb71979bd544d0147a1c.zip | |
string cleaning; "Put it in. If it breaks, tough" Theo.
work by me, useful feedback from krw, jakob, tedu, and tholo
Diffstat (limited to 'usr.sbin/bind/lib/isc/mem.c')
| -rw-r--r-- | usr.sbin/bind/lib/isc/mem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/bind/lib/isc/mem.c b/usr.sbin/bind/lib/isc/mem.c index efc6c1081a8..9cca07e2cd7 100644 --- a/usr.sbin/bind/lib/isc/mem.c +++ b/usr.sbin/bind/lib/isc/mem.c @@ -1250,7 +1250,7 @@ isc__mem_strdup(isc_mem_t *mctx, const char *s FLARG) { ns = isc__mem_allocate(mctx, len + 1 FLARG_PASS); if (ns != NULL) - strncpy(ns, s, len + 1); + strlcpy(ns, s, len + 1); return (ns); } @@ -1383,8 +1383,7 @@ isc_mempool_setname(isc_mempool_t *mpctx, const char *name) { if (mpctx->lock != NULL) LOCK(mpctx->lock); - strncpy(mpctx->name, name, sizeof(mpctx->name) - 1); - mpctx->name[sizeof(mpctx->name) - 1] = '\0'; + strlcpy(mpctx->name, name, sizeof(mpctx->name)); if (mpctx->lock != NULL) UNLOCK(mpctx->lock); |
