From 0ab9e62bac91144906d4680c000a75f75d9b6622 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 28 Feb 2010 13:54:39 +0100 Subject: Don't assign garbage to parsetime if using - (stdin) for rcfile. --- fetchmail.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 43c1e98c..b74c8897 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1032,11 +1032,14 @@ static int load_params(int argc, char **argv, int optind) } /* note the parse time, so we can pick up on modifications */ - parsetime = 0; /* foil compiler warnings */ - if (strcmp(rcfile, "-") == 0 || stat(rcfile, &rcstat) != -1) - parsetime = rcstat.st_mtime; - else if (errno != ENOENT) - report(stderr, GT_("couldn't time-check the run-control file\n")); + if (strcmp(rcfile, "-") == 0) + parsetime = time(NULL); + else { + if (stat(rcfile, &rcstat) != -1) + parsetime = rcstat.st_mtime; + else if (errno != ENOENT) + report(stderr, GT_("couldn't time-check the run-control file\n")); + } /* this builds the host list */ if ((st = prc_parse_file(rcfile, !versioninfo)) != 0) -- cgit v1.2.3