diff options
-rw-r--r-- | networking/vconfig.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/networking/vconfig.c b/networking/vconfig.c index 69c729a14..00379fc2f 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c | |||
@@ -50,13 +50,14 @@ struct vlan_ioctl_args { | |||
50 | #define VLAN_GROUP_ARRAY_LEN 4096 | 50 | #define VLAN_GROUP_ARRAY_LEN 4096 |
51 | #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ | 51 | #define SIOCSIFVLAN 0x8983 /* Set 802.1Q VLAN options */ |
52 | 52 | ||
53 | /* On entry, table points to the length of the current string plus | 53 | /* On entry, table points to the length of the current string |
54 | * nul terminator plus data length for the subsequent entry. The | 54 | * plus NUL terminator plus data length for the subsequent entry. |
55 | * return value is the last data entry for the matching string. */ | 55 | * The return value is the last data entry for the matching string. */ |
56 | static const char *xfind_str(const char *table, const char *str) | 56 | static const char *xfind_str(const char *table, const char *str) |
57 | { | 57 | { |
58 | while (strcasecmp(str, table+1) != 0) { | 58 | while (strcasecmp(str, table+1) != 0) { |
59 | if (!*(table += table[0])) { | 59 | table += table[0]; |
60 | if (!*table) { | ||
60 | bb_show_usage(); | 61 | bb_show_usage(); |
61 | } | 62 | } |
62 | } | 63 | } |
@@ -121,7 +122,7 @@ int vconfig_main(int argc, char **argv) | |||
121 | /* Will die if 802.1q is not present */ | 122 | /* Will die if 802.1q is not present */ |
122 | xopen(conf_file_name, O_RDONLY); | 123 | xopen(conf_file_name, O_RDONLY); |
123 | 124 | ||
124 | memset(&ifr, 0, sizeof(struct vlan_ioctl_args)); | 125 | memset(&ifr, 0, sizeof(ifr)); |
125 | 126 | ||
126 | ++argv; | 127 | ++argv; |
127 | p = xfind_str(cmds+2, *argv); | 128 | p = xfind_str(cmds+2, *argv); |