From cd196eca3cfc863fc4a6a272c1b125fbc237df76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 27 Dec 2010 18:09:28 +0100 Subject: [PATCH] Don't forget to initalize the variables! --- src/Math/Vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/Vector.h b/src/Math/Vector.h index a02e0ca51..63355fd9f 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -90,7 +90,7 @@ template class Vector { /** @brief Dot product */ T operator*(const Vector& other) const { - T out; + T out(0); for(size_t i = 0; i != size; ++i) out += at(i)*other.at(i); @@ -140,7 +140,7 @@ template class Vector { /** @brief Vector length */ T length() const { - T out; + T out(0); for(size_t i = 0; i != size; ++i) out += pow(at(i), 2);