From 2fda70d34b218b5bb514124e455c85ee11c63d64 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Tue, 18 Feb 2014 08:26:29 +0200 Subject: [PATCH] APRS object parsing: Timestamp may end with one of z, h or / ... and Lynn's ISS objects have HHMMSSh timestamps. Accept as valid. --- src/parse_aprs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/parse_aprs.c b/src/parse_aprs.c index aacf1fe..b4404dd 100644 --- a/src/parse_aprs.c +++ b/src/parse_aprs.c @@ -885,9 +885,10 @@ static int parse_aprs_object(struct pbuf_t *pb, const char *body, const char *bo return 0; } - /* check that the timestamp ends with a z */ - if (body[16] != 'z' && body[16] != 'Z') { - // fprintf(stderr, "\tinvalid object timestamp z character\n"); + /* check that the timestamp ends with one of the valid timestamp type IDs */ + char tz_end = body[16]; + if (tz_end != 'z' && tz_end != 'Z' && tz_end != 'h' && tz_end != '/') { + DEBUG_LOG("\tinvalid object timestamp z character"); return 0; } @@ -911,7 +912,7 @@ static int parse_aprs_object(struct pbuf_t *pb, const char *body, const char *bo pb->srcname = body; pb->srcname_len = namelen+1; - // fprintf(stderr, "\tobject name: '%.*s'\n", pb->srcname_len, pb->srcname); + DEBUG_LOG("object name: '%.*s'", pb->srcname_len, pb->srcname); /* Forward the location parsing onwards */ if (valid_sym_table_compressed(body[17])) @@ -920,7 +921,7 @@ static int parse_aprs_object(struct pbuf_t *pb, const char *body, const char *bo if (body[17] >= '0' && body[17] <= '9') return parse_aprs_uncompressed(pb, body + 17, body_end); - DEBUG_LOG("\tno valid position in object"); + DEBUG_LOG("no valid position in object"); return 0; }