diff options
author | Scott Mertz <scott@cyngn.com> | 2015-11-06 17:44:53 -0800 |
---|---|---|
committer | davidevinavil <davidevinavil@gmail.com> | 2017-01-21 18:24:49 +0100 |
commit | 5ce00344e5322de64b226b5bf779e8b3d769e723 (patch) | |
tree | 0d51b590bac935ccd1a265c78433eb18a7e24638 /gps/loc_api | |
parent | 57cf0acfc34b8791694f12a991e0cfd6d7caec77 (diff) |
z2_plus: gps: Fix build for OSS builds
gps: Correct forward declaration in proprietary definitions
Fix gps runtime error
The qcom prebuilt binary relies on FlpExtLocation_s,
so we cannot change it to FlpExtLocation.
This patch fixes it.
gps: fix remove trailing space
In setXtraUserAgent,
size_t is unsigned and never being negative.
Will cause segmentation fault, if string is all space.
Change-Id: I1cf1f956943b0739640afe909954ade6921e28a1
Diffstat (limited to 'gps/loc_api')
-rw-r--r-- | gps/loc_api/libloc_api_50001/LocEngAdapter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp index 35447d4..bea21d9 100644 --- a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -190,9 +190,11 @@ void LocEngAdapter::setXtraUserAgent() { fclose(file); // remove trailing spaces - size_t len = strlen(buf); - while (--len >= 0 && isspace(buf[len])) { - buf[len] = '\0'; + char *s; + s = buf + strlen(buf); + while (--s >= buf) { + if (!isspace(*s)) break; + *s = 0; } } |