Skip to content

Commit

Permalink
Check return value of find_nmea_start in assemble_vdm
Browse files Browse the repository at this point in the history
It wasn't properly checking to see if the start of a message was
actually found. It will now return a 3 if the message doesn't
start with $ or !
  • Loading branch information
bcl committed Oct 10, 2015
1 parent 2a075a4 commit b3acb4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c/src/vdm_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ int __stdcall assemble_vdm( ais_state *state, char *str )
/* Is the string an AIS message? Allow any start character and any
device pair.
*/
p = find_nmea_start( str );
if ( (p = find_nmea_start( str )) == NULL )
return 3;
if ( (strncmp( p+3, "VDM", 3 ) != 0)
&& (strncmp( p+3, "VDO", 3 ) != 0) )
{
Expand Down

0 comments on commit b3acb4c

Please sign in to comment.