From 0f3604a518f8b3fd35ffc344d85c71693ded0dde Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 27 Mar 2025 14:09:25 +0100 Subject: psql: Fix incorrect equality comparison Commit 1a759c83278 contained an incorrect equality comparison which was discovered by Coverity. Reported-by: Ranier Vilela Discussion: https://postgr.es/m/CAEudQApfAWzLo+oSuy2byXktdr7R8KJC_ACT5VV8fontrL35Pw@mail.gmail.com --- src/bin/psql/variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/psql/variables.c') diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c index 5150eb0532b..ae2d0e5ed3f 100644 --- a/src/bin/psql/variables.c +++ b/src/bin/psql/variables.c @@ -234,7 +234,7 @@ ParseVariableDouble(const char *value, const char *name, double *result, double * too close to zero to have full precision, by checking for zero or real * out-of-range values. */ - else if ((errno = ERANGE) && + else if ((errno == ERANGE) && (dblval == 0.0 || dblval >= HUGE_VAL || dblval <= -HUGE_VAL)) { if (name) -- cgit v1.2.3