kits/Geolocation Fix PVS404

*	Prevent use of uninitialized 'lon' by checking for successful
		result prior call

Change-Id: Ifbd649a8c0c0c37f285cda11e307013929cefa12
Reviewed-on: https://review.haiku-os.org/c/958
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
Rob Gill
2019-01-28 07:27:06 +00:00
committed by Jérôme Duval
parent 187bbba6af
commit df9641c548
+5 -2
View File
@@ -131,8 +131,11 @@ BGeolocation::LocateSelf(float& latitude, float& longitude)
double lat, lon;
result = location.FindDouble("lat", &lat);
if (result == B_OK)
result = location.FindDouble("lng", &lon);
if (result != B_OK)
return result;
result = location.FindDouble("lng", &lon);
if (result != B_OK)
return result;
latitude = lat;
longitude = lon;