summaryrefslogtreecommitdiff
path: root/networking/libiproute/ll_proto.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-25 10:55:35 +0000
committerDenis Vlasenko2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /networking/libiproute/ll_proto.c
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-80b8b39899a09c7516920cda5fd343b3086d4824.zip
busybox-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'networking/libiproute/ll_proto.c')
-rw-r--r--networking/libiproute/ll_proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 10d7498..4e62e87 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -96,7 +96,7 @@ const char * ll_proto_n2a(unsigned short id, char *buf, int len)
id = ntohs(id);
- for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
+ for (i=0; i < ARRAY_SIZE(llproto_names); i++) {
if (llproto_names[i].id == id)
return llproto_names[i].name;
}
@@ -107,7 +107,7 @@ const char * ll_proto_n2a(unsigned short id, char *buf, int len)
int ll_proto_a2n(unsigned short *id, char *buf)
{
int i;
- for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) {
+ for (i=0; i < ARRAY_SIZE(llproto_names); i++) {
if (strcasecmp(llproto_names[i].name, buf) == 0) {
*id = htons(llproto_names[i].id);
return 0;