[BusyBox-cvs] busybox/networking/libiproute ll_addr.c,1.1,1.2

Glenn McGrath bug1 at busybox.net
Thu Nov 28 12:39:23 UTC 2002


Update of /var/cvs/busybox/networking/libiproute
In directory winder:/tmp/cvs-serv24117/networking/libiproute

Modified Files:
	ll_addr.c 
Log Message:
Minor error messages changes


Index: ll_addr.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/ll_addr.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ll_addr.c	10 Nov 2002 01:33:51 -0000	1.1
+++ ll_addr.c	28 Nov 2002 12:39:19 -0000	1.2
@@ -26,7 +26,7 @@
 #include <linux/sockios.h>
 
 #include "utils.h"
-
+#include "libbb.h"
 
 const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen)
 {
@@ -57,11 +57,12 @@
 	if (strchr(arg, '.')) {
 		inet_prefix pfx;
 		if (get_addr_1(&pfx, arg, AF_INET)) {
-			fprintf(stderr, "\"%s\" is invalid lladdr.\n", arg);
+			error_msg("\"%s\" is invalid lladdr.", arg);
 			return -1;
 		}
-		if (len < 4)
+		if (len < 4) {
 			return -1;
+		}
 		memcpy(lladdr, pfx.data, 4);
 		return 4;
 	} else {
@@ -75,16 +76,17 @@
 				cp++;
 			}
 			if (sscanf(arg, "%x", &temp) != 1) {
-				fprintf(stderr, "\"%s\" is invalid lladdr.\n", arg);
+				error_msg("\"%s\" is invalid lladdr.", arg);
 				return -1;
 			}
 			if (temp < 0 || temp > 255) {
-				fprintf(stderr, "\"%s\" is invalid lladdr.\n", arg);
+				error_msg("\"%s\" is invalid lladdr.", arg);
 				return -1;
 			}
 			lladdr[i] = temp;
-			if (!cp)
+			if (!cp) {
 				break;
+			}
 			arg = cp;
 		}
 		return i+1;




More information about the busybox-cvs mailing list