diff options
Diffstat (limited to 'networking/libiproute')
-rw-r--r-- | networking/libiproute/ll_proto.c | 4 | ||||
-rw-r--r-- | networking/libiproute/ll_types.c | 2 |
2 files changed, 3 insertions, 3 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; diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c index 5d2843b..84fd628 100644 --- a/networking/libiproute/ll_types.c +++ b/networking/libiproute/ll_types.c @@ -108,7 +108,7 @@ __PF(VOID,void) #undef __PF int i; - for (i = 0; i < sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { + for (i = 0; i < ARRAY_SIZE(arphrd_names); i++) { if (arphrd_names[i].type == type) return arphrd_names[i].name; } |