git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 081ec08)
psql: Fix incorrect equality comparison
2025年3月27日 13:09:25 +0000 (14:09 +0100)
2025年3月27日 13:09:25 +0000 (14:09 +0100)
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


diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c
index 5150eb0532ba1e88e82a73ca742b42acbd13332f..ae2d0e5ed3f4720be8ea3280d1f76b0ead4eca38 100644 (file)
--- 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)
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /