groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/4] [libgroff]: Remove dead code


From: Alejandro Colomar
Subject: [PATCH 2/4] [libgroff]: Remove dead code
Date: Mon, 15 Jan 2024 00:50:58 +0100

strtol(3) can only report ERANGE, if the base is valid (and it is).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 src/libs/libgroff/curtime.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp
index 490fc3018..4623ad9a0 100644
--- a/src/libs/libgroff/curtime.cpp
+++ b/src/libs/libgroff/curtime.cpp
@@ -42,7 +42,7 @@ struct tm *current_time()
     char *endptr;
     long epoch = strtol(source_date_epoch, &endptr, 10);
 
-    if ((errno == ERANGE) || (errno != 0 && epoch == 0))
+    if (errno == ERANGE)
       fatal("$SOURCE_DATE_EPOCH: strtol: %1", strerror(errno));
     if (endptr == source_date_epoch)
       fatal("$SOURCE_DATE_EPOCH: no digits found: '%1'", endptr);
-- 
2.43.0

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]