Date: Fri, 30 Oct 2015 00:33:03 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290173 - head/usr.sbin/rtadvd Message-ID: <201510300033.t9U0X31U001007@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Fri Oct 30 00:33:03 2015 New Revision: 290173 URL: https://svnweb.freebsd.org/changeset/base/290173 Log: Use strlcpy(). MFC after: 2 weeks Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c ============================================================================== --- head/usr.sbin/rtadvd/if.c Fri Oct 30 00:30:00 2015 (r290172) +++ head/usr.sbin/rtadvd/if.c Fri Oct 30 00:33:03 2015 (r290173) @@ -358,8 +358,7 @@ update_persist_ifinfo(struct ifilist_hea ELM_MALLOC(ifi, exit(1)); ifi->ifi_ifindex = 0; - strncpy(ifi->ifi_ifname, ifname, sizeof(ifi->ifi_ifname)-1); - ifi->ifi_ifname[sizeof(ifi->ifi_ifname)-1] = '\0'; + strlcpy(ifi->ifi_ifname, ifname, sizeof(ifi->ifi_ifname)); ifi->ifi_rainfo = NULL; ifi->ifi_state = IFI_STATE_UNCONFIGURED; TAILQ_INSERT_TAIL(ifi_head, ifi, ifi_next);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510300033.t9U0X31U001007>