summaryrefslogtreecommitdiff
path: root/gps2udp.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 /gps2udp.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 'gps2udp.c')
-rw-r--r--gps2udp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gps2udp.c b/gps2udp.c
index c39004d1..7342dc05 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -33,6 +33,7 @@
#include "gpsd.h"
#include "gpsdclient.h"
#include "revision.h"
+#include "strfuncs.h"
#ifndef S_SPLINT_S
#include <sys/socket.h>
@@ -462,7 +463,7 @@ int main(int argc, char **argv)
(void)fprintf (stdout,"---> [%s] -- %s",time2string(),buffer);
// Try to extract MMSI from AIS payload
- if (strncmp (buffer,"!AIVDM",6) == 0)
+ if (str_starts_with(buffer, "!AIVDM"))
{
#define MAX_INFO 6
int i,j;