Size reductions, mostly switching things to use libbb functions.

This commit is contained in:
Rob Landley
2006-05-29 06:43:55 +00:00
parent bba7f08d27
commit a6e131dab3
6 changed files with 26 additions and 91 deletions

View File

@@ -105,7 +105,7 @@ int nameif_main(int argc, char **argv)
if (strlen(*a) > IF_NAMESIZE)
serror("interface name `%s' too long", *a);
ch = xcalloc(1, sizeof(mactable_t));
ch = xzalloc(sizeof(mactable_t));
ch->ifname = bb_xstrdup(*a++);
ch->mac = cc_macaddr(*a++);
if (clist)
@@ -126,7 +126,7 @@ int nameif_main(int argc, char **argv)
continue;
}
name_length = strcspn(line_ptr, " \t");
ch = xcalloc(1, sizeof(mactable_t));
ch = xzalloc(sizeof(mactable_t));
ch->ifname = bb_xstrndup(line_ptr, name_length);
if (name_length > IF_NAMESIZE)
serror("interface name `%s' too long", ch->ifname);