diff options
author | Jean Delvare <jdelvare@suse.de> | 2007-02-11 20:10:59 +0000 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2007-02-11 20:10:59 +0000 |
commit | 850f5935dd4d354c80a8f03f0e215aaaab5d1773 (patch) | |
tree | f907abb8e63d79e6301e734e088ed078b5947a4e /vpdopt.c | |
parent | 3e7a3c2ab90404f3849553b6d9ac7c6569ece7fb (diff) | |
download | dmidecode-git-850f5935dd4d354c80a8f03f0e215aaaab5d1773.tar.gz |
Define an ARRAY_SIZE macro which computes the size of a static array, and
use it where relevant.
Diffstat (limited to 'vpdopt.c')
-rw-r--r-- | vpdopt.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -25,6 +25,7 @@ #include <getopt.h> #include "config.h" +#include "util.h" #include "vpdopt.h" @@ -52,7 +53,7 @@ static void print_opt_string_list(void) unsigned int i; fprintf(stderr, "Valid string keywords are:\n"); - for(i=0; i<sizeof(opt_string_keyword)/sizeof(struct string_keyword); i++) + for(i=0; i<ARRAY_SIZE(opt_string_keyword); i++) { fprintf(stderr, " %s\n", opt_string_keyword[i].keyword); } @@ -68,7 +69,7 @@ static int parse_opt_string(const char *arg) return -1; } - for(i=0; i<sizeof(opt_string_keyword)/sizeof(struct string_keyword); i++) + for(i=0; i<ARRAY_SIZE(opt_string_keyword); i++) { if(!strcasecmp(arg, opt_string_keyword[i].keyword)) { |