aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gustafsson <dgustafsson@postgresql.org>2025-03-27 14:09:25 +0100
committerDaniel Gustafsson <dgustafsson@postgresql.org>2025-03-27 14:09:25 +0100
commit0f3604a518f8b3fd35ffc344d85c71693ded0dde (patch)
treebdf78374db977241a3040372715825e8acd73b8e /src
parent081ec08e6a148b06a0179bf8ac50524b1f142b68 (diff)
downloadpostgresql-0f3604a518f8b3fd35ffc344d85c71693ded0dde.tar.gz
postgresql-0f3604a518f8b3fd35ffc344d85c71693ded0dde.zip
psql: Fix incorrect equality comparison
Commit 1a759c83278 contained an incorrect equality comparison which was discovered by Coverity. Reported-by: Ranier Vilela <ranier.vf@gmail.com> Discussion: https://postgr.es/m/CAEudQApfAWzLo+oSuy2byXktdr7R8KJC_ACT5VV8fontrL35Pw@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/variables.c2
1 files changed, 1 insertions, 1 deletions
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)