From 74800349423d2f91e10d75939b66fefe315f42e3 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 8 Nov 2020 12:58:23 -0500 Subject: [PATCH] seq: Check start, step, end for NaN --- Userland/seq.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Userland/seq.cpp b/Userland/seq.cpp index 06a8822b61..e47d94fe0b 100644 --- a/Userland/seq.cpp +++ b/Userland/seq.cpp @@ -103,13 +103,10 @@ int main(int argc, const char* argv[]) return 1; } -#if 0 - // FIXME: Check for NaN once math.h has isnan(). - if (isnan(start) || isnan(step) || isnan(end)) { + if (__builtin_isnan(start) || __builtin_isnan(step) || __builtin_isnan(end)) { fprintf(stderr, "%s: start, step, and end must not be NaN\n", argv[0]); return 1; } -#endif int number_of_decimals = max(number_of_start_decimals, max(number_of_step_decimals, number_of_end_decimals));