mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-04 17:57:03 +00:00
Avoid null pointer argument in call to string comparison function
This commit is contained in:
parent
c04ec18ef7
commit
8867a9327c
@ -388,13 +388,16 @@ int decode_nmea(char *buff, sol_t *sol)
|
||||
}
|
||||
}
|
||||
/* decode nmea sentence */
|
||||
if (!strcmp(val[0], "$GPRMC"))
|
||||
if (val[0])
|
||||
{
|
||||
return decode_nmearmc(val + 1, n - 1, sol);
|
||||
}
|
||||
if (!strcmp(val[0], "$GPGGA"))
|
||||
{
|
||||
return decode_nmeagga(val + 1, n - 1, sol);
|
||||
if (!strcmp(val[0], "$GPRMC"))
|
||||
{
|
||||
return decode_nmearmc(val + 1, n - 1, sol);
|
||||
}
|
||||
if (!strcmp(val[0], "$GPGGA"))
|
||||
{
|
||||
return decode_nmeagga(val + 1, n - 1, sol);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user