diff --git a/src/parse_aprs.c b/src/parse_aprs.c index 1ca9c93..9c9a841 100644 --- a/src/parse_aprs.c +++ b/src/parse_aprs.c @@ -509,7 +509,7 @@ static int parse_aprs_nmea(struct pbuf_t *pb, const char *body, const char *body } if (!latp || !lngp) { - hlog(LOG_DEBUG, "Unknown NMEA: '%.11s' %.*s", pb->data, (int)(body_end - body), body); + hlog_packet(LOG_DEBUG, pb->data, pb->packet_len-2, "Unknown NMEA: "); return 0; /* Well.. Not NMEA frame */ } diff --git a/tests/t/31parser-nmea.t b/tests/t/31parser-nmea.t index df0c335..bd53deb 100644 --- a/tests/t/31parser-nmea.t +++ b/tests/t/31parser-nmea.t @@ -6,7 +6,7 @@ # use Test; -BEGIN { plan tests => 11 }; +BEGIN { plan tests => 12 }; use runproduct; use istest; use Ham::APRS::IS; @@ -55,6 +55,13 @@ istest::should_drop(\&ok, $i_tx, $i_rx, $tx, # should drop $dummy, 1, 1); # will pass (helper packet) +# 11: should drop, invalid char in coordinates +$tx = "OH4XYZ>GPSMW:\$GPRMO,182051.\xf000,A,6039.8655,N,01708.3799,E,20.07,243.41,070313,,,A*5A"; +$dummy = "OH5XYZ>GPSMV:\$GPRMC,212052,A,4609.1157,N,12258.8145,W,0.168,13.4,130909,17.9,E*6B"; +istest::should_drop(\&ok, $i_tx, $i_rx, + $tx, # should drop + $dummy, 1, 1); # will pass (helper packet) + # stop ok($p->stop(), 1, "Failed to stop product");