diff options
author | khali <khali> | 2007-02-11 20:10:59 +0000 |
---|---|---|
committer | khali <khali> | 2007-02-11 20:10:59 +0000 |
commit | 3592a2ee5c7ec20144582e76e7cff7f1065734fb (patch) | |
tree | f907abb8e63d79e6301e734e088ed078b5947a4e /vpdopt.c | |
parent | 943a847c96fa8cca2f7233cc572859fa369a73cd (diff) | |
download | dmidecode-3592a2ee5c7ec20144582e76e7cff7f1065734fb.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)) { |