From b0ea10a78a6ca890479fb6ef95bfbf21027acc2d Mon Sep 17 00:00:00 2001 From: Viacheslav Kruglov Date: Fri, 11 Oct 2024 12:31:06 +0200 Subject: [PATCH] Fix logical error in comparison with ULONG_MAX The expression `epoch > ULONG_MAX` will always return false because `epoch` is of type `unsigned long long`. --- src/main.c | 6 +++--- diff --git a/src/main.c b/src/main.c index 45910987e6c0a7eb48e28a2e09c75e729f0954d9..fa733c3377e105cf44efb8dabf6e5bb380674ec3 100644 --- a/src/main.c +++ b/src/main.c @@ -96,10 +96,10 @@ fprintf(stderr, "$SOURCE_DATE_EPOCH: Trailing garbage: %s\n", endptr); exit(EXIT_FAILURE); } - if (epoch > ULONG_MAX) { + if (epoch > ULLONG_MAX) { fprintf(stderr, "$SOURCE_DATE_EPOCH: value must be smaller than or " - "equal to %lu but was found to be: %llu \n", - ULONG_MAX, epoch); + "equal to %llu but was found to be: %llu \n", + ULLONG_MAX, epoch); exit(EXIT_FAILURE); } date_time = epoch; -- 2.48.1