]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
use ARRAY_SIZE
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 8 Dec 2008 11:59:55 +0000 (12:59 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Mon, 8 Dec 2008 11:59:55 +0000 (12:59 +0100)
scan.c

diff --git a/scan.c b/scan.c
index ac2f48cb147b90fa7e8014118cf8221b072e9d92..218d853727a523f0e43b85462d8bac7e61cc4603 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -93,12 +93,11 @@ static const printfn ieprinters[] = {
        [50] = print_supprates,
        [221] = print_vendor,
 };
-#define NUMPRINTERS (sizeof(ieprinters)/sizeof(ieprinters[0]))
 
 static void print_ies(unsigned char *ie, int ielen)
 {
        while (ielen >= 2 && ielen >= ie[1]) {
-               if (ie[0] < NUMPRINTERS && ieprinters[ie[0]]) {
+               if (ie[0] < ARRAY_SIZE(ieprinters) && ieprinters[ie[0]]) {
                        ieprinters[ie[0]](ie[0], ie[1], ie + 2);
                } else {
                        int i;