bmon: Properly pass NULL pointers instead of 0

Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
Thomas Graf 2015-12-16 14:09:35 +01:00
parent 753a9e09dd
commit 4488cd03f9
2 changed files with 17 additions and 17 deletions

View File

@ -127,10 +127,10 @@ static void parse_args_pre(int argc, char *argv[])
char *gostr = "+:hvVf:"; char *gostr = "+:hvVf:";
struct option long_opts[] = { struct option long_opts[] = {
{"help", 0, 0, 'h'}, {"help", 0, NULL, 'h'},
{"version", 0, 0, 'v'}, {"version", 0, NULL, 'v'},
{"configfile", 1, 0, 'f'}, {"configfile", 1, NULL, 'f'},
{0, 0, 0, 0}, {NULL, 0, NULL, 0},
}; };
int c = getopt_long(argc, argv, gostr, long_opts, NULL); int c = getopt_long(argc, argv, gostr, long_opts, NULL);
if (c == -1) if (c == -1)
@ -166,17 +166,17 @@ static int parse_args_post(int argc, char *argv[])
"L:hvVf:"; "L:hvVf:";
struct option long_opts[] = { struct option long_opts[] = {
{"input", 1, 0, 'i'}, {"input", 1, NULL, 'i'},
{"output", 1, 0, 'o'}, {"output", 1, NULL, 'o'},
{"policy", 1, 0, 'p'}, {"policy", 1, NULL, 'p'},
{"read-interval", 1, 0, 'r'}, {"read-interval", 1, NULL, 'r'},
{"rate-interval", 1, 0, 'R'}, {"rate-interval", 1, NULL, 'R'},
{"sleep-interval", 1, 0, 's'}, {"sleep-interval", 1, NULL, 's'},
{"show-all", 0, 0, 'a'}, {"show-all", 0, NULL, 'a'},
{"use-si", 0, 0, 'U'}, {"use-si", 0, NULL, 'U'},
{"use-bit", 0, 0, 'b'}, {"use-bit", 0, NULL, 'b'},
{"lifetime", 1, 0, 'L'}, {"lifetime", 1, NULL, 'L'},
{0, 0, 0, 0}, {NULL, 0, NULL, 0},
}; };
int c = getopt_long(argc, argv, gostr, long_opts, NULL); int c = getopt_long(argc, argv, gostr, long_opts, NULL);
if (c == -1) if (c == -1)
@ -261,7 +261,7 @@ int main(int argc, char *argv[])
unsigned long sleep_time; unsigned long sleep_time;
double read_interval; double read_interval;
start_time = time(0); start_time = time(NULL);
memset(&rtiming, 0, sizeof(rtiming)); memset(&rtiming, 0, sizeof(rtiming));
rtiming.rt_variance.v_min = FLT_MAX; rtiming.rt_variance.v_min = FLT_MAX;

View File

@ -185,7 +185,7 @@ static void dummy_parse_opt(const char *type, const char *value)
c_numdev = strtol(value, NULL, 0); c_numdev = strtol(value, NULL, 0);
else if (!strcasecmp(type, "randomize")) { else if (!strcasecmp(type, "randomize")) {
c_randomize = 1; c_randomize = 1;
srand(time(0)); srand(time(NULL));
} else if (!strcasecmp(type, "seed") && value) } else if (!strcasecmp(type, "seed") && value)
srand(strtol(value, NULL, 0)); srand(strtol(value, NULL, 0));
else if (!strcasecmp(type, "mtu") && value) else if (!strcasecmp(type, "mtu") && value)