*: s/IF_NAMESIZE/IFNAMSIZ/, regularize its use a bit.

function                                             old     new   delta
strncpy_IFNAMSIZ                                       -      13     +13
set_slave_mtu                                         39      37      -2
set_slave_hwaddr                                      52      50      -2
set_master_hwaddr                                     52      50      -2
set_if_flags                                          40      38      -2
get_if_settings                                      101      98      -3
ifenslave_main                                      1680    1661     -19
vconfig_main                                         306     280     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/7 up/down: 13/-56)            Total: -43 bytes
This commit is contained in:
Denis Vlasenko
2008-04-21 02:21:45 +00:00
parent 0a1446275d
commit 01eaee9309
7 changed files with 47 additions and 51 deletions

View File

@@ -133,10 +133,7 @@ int vconfig_main(int argc, char **argv)
if (ifr.cmd == SET_VLAN_NAME_TYPE_CMD) { /* set_name_type */
ifr.u.name_type = *xfind_str(name_types+1, argv[1]);
} else {
if (strlen(argv[1]) >= IF_NAMESIZE) {
bb_error_msg_and_die("if_name >= %d chars", IF_NAMESIZE);
}
strcpy(ifr.device1, argv[1]);
strncpy(ifr.device1, argv[1], IFNAMSIZ);
p = argv[2];
/* I suppose one could try to combine some of the function calls below,