diff options
author | Glenn L McGrath | 2002-11-28 12:39:19 +0000 |
---|---|---|
committer | Glenn L McGrath | 2002-11-28 12:39:19 +0000 |
commit | 1b0813ab613c59c875f142eebfde7a07fbc34964 (patch) | |
tree | 02820419075cf7903982f5b6a50ed6e70e22b6f0 /networking | |
parent | d4de975cd2860e321b44211ecef4d61b050f1304 (diff) | |
download | busybox-1b0813ab613c59c875f142eebfde7a07fbc34964.zip busybox-1b0813ab613c59c875f142eebfde7a07fbc34964.tar.gz |
Minor error messages changes
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/ll_addr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c index 51ff13b..19b3136 100644 --- a/networking/libiproute/ll_addr.c +++ b/networking/libiproute/ll_addr.c @@ -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 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg) 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 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg) 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; |