From 9b9072c77d415000b110627c0f5aaa7f9d642d19 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 13 Jul 2013 16:46:51 +0200 Subject: sparse: netsniff-ng, trafgen: fix remaining time(0) warnings Those are the last occurences of warnings like: netsniff-ng.c:697:48: warning: Using plain integer as NULL pointer netsniff-ng.c:726:48: warning: Using plain integer as NULL pointer ... Signed-off-by: Daniel Borkmann --- netsniff-ng.c | 4 ++-- trafgen.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/netsniff-ng.c b/netsniff-ng.c index 644a351..7b08ed0 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -694,7 +694,7 @@ static int next_multi_pcap_file(struct ctx *ctx, int fd) close(fd); slprintf(fname, sizeof(fname), "%s/%s%lu.pcap", ctx->device_out, - ctx->prefix ? : "dump-", time(0)); + ctx->prefix ? : "dump-", time(NULL)); fd = open_or_die_m(fname, O_RDWR | O_CREAT | O_TRUNC | O_LARGEFILE, DEFFILEMODE); @@ -723,7 +723,7 @@ static int begin_multi_pcap_file(struct ctx *ctx) ctx->device_out[strlen(ctx->device_out) - 1] = 0; slprintf(fname, sizeof(fname), "%s/%s%lu.pcap", ctx->device_out, - ctx->prefix ? : "dump-", time(0)); + ctx->prefix ? : "dump-", time(NULL)); fd = open_or_die_m(fname, O_RDWR | O_CREAT | O_TRUNC | O_LARGEFILE, DEFFILEMODE); diff --git a/trafgen.c b/trafgen.c index a370333..2e32f09 100644 --- a/trafgen.c +++ b/trafgen.c @@ -865,7 +865,7 @@ static unsigned int generate_srand_seed(void) fd = open("/dev/urandom", O_RDONLY); if (fd < 0) - return time(0); + return time(NULL); read_or_die(fd, &_seed, sizeof(_seed)); -- cgit v1.2.3-54-g00ecf