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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to