svn commit: trunk/busybox/networking
vodz at busybox.net
vodz at busybox.net
Sun Jan 15 09:29:43 UTC 2006
Author: vodz
Date: 2006-01-15 01:29:41 -0800 (Sun, 15 Jan 2006)
New Revision: 13342
Log:
restore erronyous 'cleanups' by Rob Sullivan and landley
Modified:
trunk/busybox/networking/nameif.c
Changeset:
Modified: trunk/busybox/networking/nameif.c
===================================================================
--- trunk/busybox/networking/nameif.c 2006-01-15 09:09:50 UTC (rev 13341)
+++ trunk/busybox/networking/nameif.c 2006-01-15 09:29:41 UTC (rev 13342)
@@ -60,16 +60,17 @@
openlog(bb_applet_name, 0, LOG_LOCAL0);
vsyslog(LOG_ERR, s, ap);
closelog();
- } else
- bb_error_msg(s, ap);
-
+ } else {
+ bb_verror_msg(s, ap);
+ putc('\n', stderr);
+ }
va_end(ap);
exit(EXIT_FAILURE);
}
/* Check ascii str_macaddr, convert and copy to *mac */
-static struct ether_addr *cc_macaddr(char *str_macaddr)
+static struct ether_addr *cc_macaddr(const char *str_macaddr)
{
struct ether_addr *lmac, *mac;
@@ -94,7 +95,7 @@
flags = bb_getopt_ulflags(argc, argv, "sc:", &fname);
- if (argc - optind == 1)
+ if ((argc - optind) & 1)
bb_show_usage();
if (optind < argc) {
@@ -120,8 +121,10 @@
size_t name_length;
line_ptr = line + strspn(line, " \t");
- if ((line_ptr[0] == '#') || (line_ptr[0] == '\n'))
+ if ((line_ptr[0] == '#') || (line_ptr[0] == '\n')) {
+ free(line);
continue;
+ }
name_length = strcspn(line_ptr, " \t");
ch = xcalloc(1, sizeof(mactable_t));
ch->ifname = bb_xstrndup(line_ptr, name_length);
More information about the busybox-cvs
mailing list