diff --git a/ircd/s_newconf.c b/ircd/s_newconf.c index c755d6e3..6ecf1a51 100644 --- a/ircd/s_newconf.c +++ b/ircd/s_newconf.c @@ -694,8 +694,6 @@ valid_temp_time(const char *p) errno = 0; current = strtol(p, &endp, 10); - if (errno == ERANGE) - return -1; if (endp == p) return -1; if (current < 0) diff --git a/tests/misc.c b/tests/misc.c index 88e2c1e2..0e10ae67 100644 --- a/tests/misc.c +++ b/tests/misc.c @@ -67,7 +67,11 @@ static void valid_temp_time_overflow(void) t = valid_temp_time(s); is_int(52 * WEEK, t, MSG); - snprintf(s, sizeof s, "%" PRIuMAX "m%" PRIuMAX "m", UINTMAX_MAX / 60 - 1, UINTMAX_MAX / 60 - 1); + snprintf(s, sizeof s, "%ldm", LONG_MAX / 60 + 2); + t = valid_temp_time(s); + is_int(52 * WEEK, t, MSG); + + snprintf(s, sizeof s, "%ldm%ldm", LONG_MAX / 60 - 1, LONG_MAX / 60 - 1); t = valid_temp_time(s); is_int(52 * WEEK, t, MSG); }