diff options
author | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-15 09:29:41 +0000 |
---|---|---|
committer | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-15 09:29:41 +0000 |
commit | 0c482ced822cfada034ff19b3e1b81f0ef6a6cf8 (patch) | |
tree | 2e2583ed13cc1234397ad941ee6abc8bf4bf916f | |
parent | bc77d5a22d6cbe049ce213d216aeb4f61db073f7 (diff) | |
download | busybox-w32-0c482ced822cfada034ff19b3e1b81f0ef6a6cf8.tar.gz busybox-w32-0c482ced822cfada034ff19b3e1b81f0ef6a6cf8.tar.bz2 busybox-w32-0c482ced822cfada034ff19b3e1b81f0ef6a6cf8.zip |
restore erronyous 'cleanups' by Rob Sullivan and landley
git-svn-id: svn://busybox.net/trunk/busybox@13342 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | networking/nameif.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/networking/nameif.c b/networking/nameif.c index 5fee465cc..a2c8b4915 100644 --- a/networking/nameif.c +++ b/networking/nameif.c | |||
@@ -60,16 +60,17 @@ static void serror(const char *s, ...) | |||
60 | openlog(bb_applet_name, 0, LOG_LOCAL0); | 60 | openlog(bb_applet_name, 0, LOG_LOCAL0); |
61 | vsyslog(LOG_ERR, s, ap); | 61 | vsyslog(LOG_ERR, s, ap); |
62 | closelog(); | 62 | closelog(); |
63 | } else | 63 | } else { |
64 | bb_error_msg(s, ap); | 64 | bb_verror_msg(s, ap); |
65 | 65 | putc('\n', stderr); | |
66 | } | ||
66 | va_end(ap); | 67 | va_end(ap); |
67 | 68 | ||
68 | exit(EXIT_FAILURE); | 69 | exit(EXIT_FAILURE); |
69 | } | 70 | } |
70 | 71 | ||
71 | /* Check ascii str_macaddr, convert and copy to *mac */ | 72 | /* Check ascii str_macaddr, convert and copy to *mac */ |
72 | static struct ether_addr *cc_macaddr(char *str_macaddr) | 73 | static struct ether_addr *cc_macaddr(const char *str_macaddr) |
73 | { | 74 | { |
74 | struct ether_addr *lmac, *mac; | 75 | struct ether_addr *lmac, *mac; |
75 | 76 | ||
@@ -94,7 +95,7 @@ int nameif_main(int argc, char **argv) | |||
94 | 95 | ||
95 | flags = bb_getopt_ulflags(argc, argv, "sc:", &fname); | 96 | flags = bb_getopt_ulflags(argc, argv, "sc:", &fname); |
96 | 97 | ||
97 | if (argc - optind == 1) | 98 | if ((argc - optind) & 1) |
98 | bb_show_usage(); | 99 | bb_show_usage(); |
99 | 100 | ||
100 | if (optind < argc) { | 101 | if (optind < argc) { |
@@ -120,8 +121,10 @@ int nameif_main(int argc, char **argv) | |||
120 | size_t name_length; | 121 | size_t name_length; |
121 | 122 | ||
122 | line_ptr = line + strspn(line, " \t"); | 123 | line_ptr = line + strspn(line, " \t"); |
123 | if ((line_ptr[0] == '#') || (line_ptr[0] == '\n')) | 124 | if ((line_ptr[0] == '#') || (line_ptr[0] == '\n')) { |
125 | free(line); | ||
124 | continue; | 126 | continue; |
127 | } | ||
125 | name_length = strcspn(line_ptr, " \t"); | 128 | name_length = strcspn(line_ptr, " \t"); |
126 | ch = xcalloc(1, sizeof(mactable_t)); | 129 | ch = xcalloc(1, sizeof(mactable_t)); |
127 | ch->ifname = bb_xstrndup(line_ptr, name_length); | 130 | ch->ifname = bb_xstrndup(line_ptr, name_length); |