From cb01268562a47e6a1c32559f58fbadd46e52d304 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 27 Nov 2018 21:58:00 -0500 Subject: Fix many errors found by PVS-Studio Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15. --- core/variant_op.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/variant_op.cpp b/core/variant_op.cpp index d193858966..9f172f0d57 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -2149,7 +2149,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) int idx = p_index; if (idx < 0) idx += 4; - if (idx >= 0 || idx < 4) { + if (idx >= 0 && idx < 4) { Color *v = reinterpret_cast(_data._mem); (*v)[idx] = p_value; valid = true; @@ -2524,7 +2524,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const { int idx = p_index; if (idx < 0) idx += 4; - if (idx >= 0 || idx < 4) { + if (idx >= 0 && idx < 4) { const Color *v = reinterpret_cast(_data._mem); valid = true; return (*v)[idx]; -- cgit v1.2.3