From: Johannes Berg Date: Mon, 8 Dec 2008 11:59:55 +0000 (+0100) Subject: use ARRAY_SIZE X-Git-Tag: v0.9.10~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97ebbaf55e8729c28513d8a73f3e65e8d759ff80;p=thirdparty%2Fiw.git use ARRAY_SIZE --- diff --git a/scan.c b/scan.c index ac2f48c..218d853 100644 --- 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;