land: gps: fix build for OSS builds
Squash of the following commits: gps: Correct forward declaration in proprietary definitions The qcom prebuilt binary relies on FlpExtLocation_s, so we cannot change it to FlpExtLocation. This patch fixes it. karate: 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
This commit is contained in:
parent
ecf15a1c13
commit
85a6b00c53
2 changed files with 10 additions and 5 deletions
|
@ -30,7 +30,10 @@
|
|||
#define ULP_PROXY_BASE_H
|
||||
|
||||
#include <gps_extended.h>
|
||||
#include "fused_location_extended.h"
|
||||
|
||||
struct FlpExtLocation_s;
|
||||
struct FlpExtBatchOptions;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterBase;
|
||||
|
@ -101,7 +104,7 @@ public:
|
|||
(void)active;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportPositions(const FlpExtLocation* locations,
|
||||
inline virtual bool reportPositions(const struct FlpExtLocation_s* locations,
|
||||
int32_t number_of_locations) {
|
||||
(void)locations;
|
||||
(void)number_of_locations;
|
||||
|
|
|
@ -195,9 +195,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue