From 47068e88fba5b8a79ae8a9a09dadac684869faa6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Nov 2012 10:03:25 +0000 Subject: BGE: fix for 2 uses of uninitialized memory - property-sensor and object-color for materials. --- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/gameengine/GameLogic') diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index ced3b8418fe..f02ac495233 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -152,13 +152,11 @@ bool SCA_PropertySensor::CheckPropertyCondition() */ if (result==false && dynamic_cast(orgprop) != NULL) { float f; - - if (EOF == sscanf(m_checkpropval.ReadPtr(), "%f", &f)) - { - //error + if (sscanf(m_checkpropval.ReadPtr(), "%f", &f) == 1) { + result = (f == ((CFloatValue *)orgprop)->GetFloat()); } else { - result = (f == ((CFloatValue *)orgprop)->GetFloat()); + /* error */ } } /* end patch */ -- cgit v1.2.3