summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-26 14:28:33 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-26 14:28:33 -0500
commitbab8757bc9e0b64883c8eeaa9ce5bd1909bbdcd4 (patch)
tree9f8a539fcdefa2e964c9573a28ade569977aa98c /drivers.c
parent6313827df2a9a0067132626a886e628990715064 (diff)
downloadgpsd-bab8757bc9e0b64883c8eeaa9ce5bd1909bbdcd4.tar.gz
Pre-release splint/cppcheck/coverity cleanup. All regression tests pass.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers.c b/drivers.c
index 6b993c4f..576ef574 100644
--- a/drivers.c
+++ b/drivers.c
@@ -7,6 +7,7 @@
#include <stdbool.h>
#include <string.h>
#include <stdarg.h>
+#include <assert.h>
#include <ctype.h>
#ifndef S_SPLINT_S
#include <unistd.h>
@@ -1417,7 +1418,6 @@ const struct gps_type_t driver_aivdm = {
static void path_rewrite(struct gps_device_t *session, char *prefix)
/* prepend the session path to the value of a specified attribute */
{
-
/*
* Hack the packet to reflect its origin. This code is supposed
* to insert the path naming the remote gpsd instance into the
@@ -1426,6 +1426,10 @@ static void path_rewrite(struct gps_device_t *session, char *prefix)
*/
char *prefloc;
+#ifdef S_SPLINT_S
+ assert(prefix != NULL && session->lexer.outbuffer != NULL);
+#endif /* S_SPLINT_S */
+
/* possibly the rewrite has been done already, this comw up in gpsmon */
if (strstr((char *)session->lexer.outbuffer, session->gpsdata.dev.path) != NULL)
return;