summaryrefslogtreecommitdiff
path: root/libgps_sock.c
diff options
context:
space:
mode:
authorZbigniew Chyla <zbigniew.chyla@nsn.com>2015-01-16 15:46:59 +0100
committerEric S. Raymond <esr@thyrsus.com>2015-01-21 10:47:00 -0500
commitd0174ca4e78831bbdd798d02a481ba2569425722 (patch)
tree3bcdd83bb0e0fabcbc2e1e8e84c7befffc19c3cc /libgps_sock.c
parent39554efdf0416e35236ad3d23a3a893d90c68be6 (diff)
downloadgpsd-d0174ca4e78831bbdd798d02a481ba2569425722.tar.gz
Add str_starts_with macro, use it instead of strncmp.
This change doesn't affect generated binary code.
Diffstat (limited to 'libgps_sock.c')
-rw-r--r--libgps_sock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgps_sock.c b/libgps_sock.c
index 99b39b1a..02164f62 100644
--- a/libgps_sock.c
+++ b/libgps_sock.c
@@ -33,6 +33,7 @@
#include "gps.h"
#include "gpsd.h"
#include "libgps.h"
+#include "strfuncs.h"
#ifdef SOCKET_EXPORT_ENABLE
#include "gps_json.h"
@@ -272,7 +273,7 @@ int gps_unpack(char *buf, struct gps_data_t *gpsdata)
#endif /* __UNUSED__ */
for (ns = buf; ns; ns = strstr(ns + 1, "GPSD")) {
- if ( /*@i1@*/ strncmp(ns, "GPSD", 4) == 0) {
+ if (str_starts_with(ns, "GPSD")) {
/* the following should execute each time we have a good next sp */
for (sp = ns + 5; *sp != '\0'; sp = tp + 1) {
bool eol;