system/corennnnn
修订版 | 8312fb4860c4b43c4cde77a08a6b6f135d89baa6 (tree) |
---|---|
时间 | 2016-09-15 09:00:34 |
作者 | Linux Build Service Account <lnxbuild@loca...> |
Commiter | Gerrit - the friendly Code Review server |
Merge "system/core: Replace banned strncpy with strlcpy function"
@@ -173,8 +173,7 @@ void ifc_close6(void) | ||
173 | 173 | static void ifc_init_ifr(const char *name, struct ifreq *ifr) |
174 | 174 | { |
175 | 175 | memset(ifr, 0, sizeof(struct ifreq)); |
176 | - strncpy(ifr->ifr_name, name, IFNAMSIZ); | |
177 | - ifr->ifr_name[IFNAMSIZ - 1] = 0; | |
176 | + strlcpy(ifr->ifr_name, name, IFNAMSIZ); | |
178 | 177 | } |
179 | 178 | |
180 | 179 | int ifc_get_hwaddr(const char *name, void *ptr) |