From b8ec2dfc96bd954b273c232a12bf6ec5f9e20591 Mon Sep 17 00:00:00 2001 From: SHIRAKATA Kentaro Date: Mon, 23 Jan 2023 16:34:24 +0900 Subject: [PATCH] Avoid casting time_t to int As time_t may not fit int, cast -1 to time_t instead. --- src/hacklib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hacklib.c b/src/hacklib.c index 8ba5f9179..2ad8d6c66 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1157,7 +1157,7 @@ time_from_yyyymmddhhmmss(char *buf) t.tm_sec = atoi(s); timeresult = mktime(&t); } - if ((int) timeresult == -1) + if (timeresult == (time_t) -1) debugpline1("time_from_yyyymmddhhmmss(%s) would have returned -1", buf ? buf : ""); else