From 9b58fe9c0b7b10bca17f033d7928e65ab5065fc9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 15 Jul 2013 05:15:46 +0200 Subject: ip: code shrink function old new delta do_ipaddr 78 81 +3 do_iprule 140 139 -1 do_iptunnel 283 278 -5 iprule_modify 851 841 -10 ipaddr_modify 1293 1236 -57 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/4 up/down: 3/-73) Total: -70 bytes Signed-off-by: Denys Vlasenko --- networking/libiproute/iprule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'networking/libiproute/iprule.c') diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index 241a6bf9d..8dbe6bd92 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c @@ -215,7 +215,7 @@ static int iprule_modify(int cmd, char **argv) while (*argv) { key = index_in_substrings(keywords, *argv) + 1; if (key == 0) /* no match found in keywords array, bail out. */ - bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name); + invarg(*argv, applet_name); if (key == ARG_from) { inet_prefix dst; NEXT_ARG(); @@ -308,9 +308,9 @@ int FAST_FUNC do_iprule(char **argv) static const char ip_rule_commands[] ALIGN1 = "add\0""delete\0""list\0""show\0"; if (*argv) { - smalluint cmd = index_in_substrings(ip_rule_commands, *argv); - if (cmd > 3) - bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name); + int cmd = index_in_substrings(ip_rule_commands, *argv); + if (cmd < 0) + invarg(*argv, applet_name); argv++; if (cmd < 2) return iprule_modify((cmd == 0) ? RTM_NEWRULE : RTM_DELRULE, argv); -- cgit v1.2.3