From: epg <> Date: Fri, 6 Sep 2002 06:32:49 +0000 (+0000) Subject: (get_filename): Handle failure cases for time(3) and gmtime(3). X-Git-Url: https://diplodocus.org/git/mdeliver/commitdiff_plain/77139f24964581ac8509190b1ca71a155d677317?ds=inline (get_filename): Handle failure cases for time(3) and gmtime(3). --- diff --git a/mdeliver.c b/mdeliver.c index 756a07c..0073c47 100644 --- a/mdeliver.c +++ b/mdeliver.c @@ -96,7 +96,14 @@ get_filename(char *fn) for (try = 0; ; try++) { now = time(NULL); + if (now == -1) { + err(MDELIVER_EXITCODE, "Failed time()"); + } + t = gmtime(&now); + if (!t) { + err(MDELIVER_EXITCODE, "Failed gmtime()"); + } buildfn = fn + sprintf(fn, "tmp/"); buildfn += strftime(buildfn, LEN_ULONG + 1, "%s.", t);