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 <jerome.duval@gmail.com>
This commit is contained in:
parent
187bbba6af
commit
df9641c548
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user