summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r--sbin/ifconfig/ifconfig.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 0e6ae2b..d8dd71b 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -596,9 +596,11 @@ main(int argc, char *argv[])
addrcount++;
next += nextifm->ifm_msglen;
}
- strlcpy(name, sdl->sdl_data,
- sizeof(name) <= sdl->sdl_nlen ?
- sizeof(name) : sdl->sdl_nlen + 1);
+ memcpy(name, sdl->sdl_data,
+ sizeof(name) < sdl->sdl_nlen ?
+ sizeof(name)-1 : sdl->sdl_nlen);
+ name[sizeof(name) < sdl->sdl_nlen ?
+ sizeof(name)-1 : sdl->sdl_nlen] = '\0';
if (all || namesonly) {
if (uponly)
OpenPOWER on IntegriCloud