[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/10] [libgroff]: Remove dead code
From: |
Alejandro Colomar |
Subject: |
[PATCH v4 02/10] [libgroff]: Remove dead code |
Date: |
Sat, 16 Mar 2024 12:54:28 +0100 |
strtol(3) can only report ERANGE, if the base is valid (and it is).
Fixes: e4290210f2c1 ("Implement `SOURCE_DATE_EPOCH' for reproducible builds.")
Link: <https://savannah.gnu.org/bugs/?65451>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Dave Kemper <saint.snit@gmail.com>
Cc: "James K. Lowden" <jklowden@schemamania.org>
Cc: Colin Watson <cjwatson@debian.org>
Cc: Werner LEMBERG <wl@gnu.org>
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
signature.asc
Description: PGP signature
[PATCH v3 2/9] [libgroff]: Remove dead code, Alejandro Colomar, 2024/03/15
[PATCH v3 3/9] src/: Remove redundant checks after strtol(3)., Alejandro Colomar, 2024/03/15
[PATCH v3 4/9] [grolbp]: Remove bogus (and redundant) check, Alejandro Colomar, 2024/03/15
[PATCH v3 0/9] strtol(3)-related fixes, Alejandro Colomar, 2024/03/15
- [PATCH v4 00/10] strtol(3)-related fixes, Alejandro Colomar, 2024/03/16
- [PATCH v4 01/10] [libgroff]: Remove redundant checks., Alejandro Colomar, 2024/03/16
- [PATCH v4 02/10] [libgroff]: Remove dead code,
Alejandro Colomar <=
- [PATCH v4 03/10] src/: Remove redundant checks after strtol(3)., Alejandro Colomar, 2024/03/16
- [PATCH v4 04/10] [grolbp]: Remove bogus (and redundant) check, Alejandro Colomar, 2024/03/16
- [PATCH v4 05/10] src/: ceil_prime(): Add function to get the lowest prime not less than n, Alejandro Colomar, 2024/03/16
- [PATCH v4 06/10] [indxbib]: Don't else after [[noreturn]], Alejandro Colomar, 2024/03/16
- [PATCH v4 07/10] [indxbib]: Clear errno before calling strtol(3), Alejandro Colomar, 2024/03/16
- [PATCH v4 10/10] [grolbp]: Fix range check after strtol(3), Alejandro Colomar, 2024/03/16
- Re: [PATCH v4 10/10] [grolbp]: Fix range check after strtol(3), Alejandro Colomar, 2024/03/16
- [PATCH v4 08/10] [indxbib]: Remove dead code, Alejandro Colomar, 2024/03/16
- [PATCH v4 09/10] [indxbib]: Collapse related tests, Alejandro Colomar, 2024/03/16
- [PATCH v5 00/10] strtol(3)-related fixes, Alejandro Colomar, 2024/03/16