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:
@@ -131,8 +131,11 @@ BGeolocation::LocateSelf(float& latitude, float& longitude)
|
|||||||
|
|
||||||
double lat, lon;
|
double lat, lon;
|
||||||
result = location.FindDouble("lat", &lat);
|
result = location.FindDouble("lat", &lat);
|
||||||
if (result == B_OK)
|
if (result != B_OK)
|
||||||
result = location.FindDouble("lng", &lon);
|
return result;
|
||||||
|
result = location.FindDouble("lng", &lon);
|
||||||
|
if (result != B_OK)
|
||||||
|
return result;
|
||||||
|
|
||||||
latitude = lat;
|
latitude = lat;
|
||||||
longitude = lon;
|
longitude = lon;
|
||||||
|
|||||||
Reference in New Issue
Block a user