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 | |
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
-rw-r--r-- | gps/core/UlpProxyBase.h | 6 | ||||
-rw-r--r-- | gps/loc_api/libloc_api_50001/LocEngAdapter.cpp | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h index 59e265e..efcf98a 100644 --- a/gps/core/UlpProxyBase.h +++ b/gps/core/UlpProxyBase.h @@ -30,7 +30,9 @@ #define ULP_PROXY_BASE_H #include <gps_extended.h> -#include "fused_location_extended.h" + +struct FlpExtLocation_s; +struct FlpExtBatchOptions; namespace loc_core { @@ -73,7 +75,7 @@ public: bool active) { return false; } - inline virtual bool reportPositions(const FlpExtLocation* locations, + inline virtual bool reportPositions(const struct FlpExtLocation_s* locations, int32_t number_of_locations) { return false; } 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; } } |