From a941c5524852826f904f5f53e3867081cc7c36ec Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 26 Dec 2021 20:09:14 +0000 Subject: [PATCH] [Minor] Sigh, one more fix to the conditions --- src/libserver/css/css_tokeniser.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libserver/css/css_tokeniser.cxx b/src/libserver/css/css_tokeniser.cxx index fe547d82c..737b3460d 100644 --- a/src/libserver/css/css_tokeniser.cxx +++ b/src/libserver/css/css_tokeniser.cxx @@ -363,12 +363,12 @@ auto css_tokeniser::consume_number() -> struct css_parser_token if (i > offset) { /* I wish it was supported properly */ //auto conv_res = std::from_chars(&input[offset], &input[i], num); - char numbuf[128], *endptr = NULL; + char numbuf[128], *endptr = nullptr; rspamd_strlcpy(numbuf, &input[offset], MIN(i - offset + 1, sizeof(numbuf))); auto num = g_ascii_strtod(numbuf, &endptr); offset = i; - if ((endptr && *endptr != '\0') || num >= G_MAXFLOAT || num <= G_MINFLOAT || std::isnan(num)) { + if (fabs (num) >= G_MAXFLOAT || std::isnan(num)) { msg_debug_css("invalid number: %s", numbuf); return make_token(input[i - 1]); } -- 2.39.5