ERANGE can only happen if strtol(3) returns either LONG_MIN or LONG_MAX. Link: <https://savannah.gnu.org/bugs/?65451> Cc: "G. Branden Robinson" <[email protected]> Cc: Dave Kemper <[email protected]> Cc: "James K. Lowden" <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]> --- src/libs/libgroff/curtime.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp
index 277755cab..490fc3018 100644
--- a/src/libs/libgroff/curtime.cpp
+++ b/src/libs/libgroff/curtime.cpp
@@ -42,8 +42,7 @@ struct tm *current_time()
char *endptr;
long epoch = strtol(source_date_epoch, &endptr, 10);
- if ((errno == ERANGE && (epoch == LONG_MAX || epoch == LONG_MIN)) ||
- (errno != 0 && epoch == 0))
+ if ((errno == ERANGE) || (errno != 0 && epoch == 0))
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
signature.asc
Description: PGP signature
