libbb: add strncpy_IFNAMSIZ

function                                             old     new   delta
...
udhcp_read_interface                                 225     220      -5
brctl_main                                          1151    1146      -5
add_interface                                        109     104      -5
ipaddr_list_or_flush                                2174    2167      -7
do_add_ioctl                                          88      80      -8
vconfig_main                                         249     240      -9
do_del_ioctl                                          78      68     -10
do_iplink                                           1186    1173     -13
do_if_fetch                                          766     753     -13
buffer_fill_and_print                                196     179     -17
parse_args                                          1709    1684     -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/20 up/down: 11/-140)         Total: -129 bytes
This commit is contained in:
Denis Vlasenko
2008-12-02 18:18:50 +00:00
parent 928b2c0fee
commit 360d9661b6
19 changed files with 52 additions and 49 deletions

View File

@@ -47,7 +47,7 @@ int FAST_FUNC udhcp_read_interface(const char *interface, int *ifindex, uint32_t
fd = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW);
ifr.ifr_addr.sa_family = AF_INET;
strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name));
strncpy_IFNAMSIZ(ifr.ifr_name, interface);
if (addr) {
if (ioctl_or_perror(fd, SIOCGIFADDR, &ifr,
"is interface %s up and configured?", interface)