diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-30 13:41:52 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-30 13:41:52 -0400 |
commit | bc6f155c379b3851076c778ec66b367e0552d49e (patch) | |
tree | 33a30ca8a8623f2f7ff64cc2b8c13b906236dd3a /gpsmon.c | |
parent | 53a43fb5416417474e32120e8fcd8694ec496f4c (diff) | |
download | gpsd-bc6f155c379b3851076c778ec66b367e0552d49e.tar.gz |
In gpsmon, omit hexdumping trailing CR/LF when dumping textual packets.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -204,6 +204,12 @@ static void cond_hexdump(/*@out@*/char *buf2, size_t len2, buf2[j] = '\0'; } else { + if (TEXTUAL_PACKET_TYPE(session.lexer.type)) { + if (i == len - 1 && buf[i] == '\n') + continue; + if (i == len - 2 && buf[i] == '\r') + continue; + } (void)snprintf(&buf2[j], len2-strlen(buf2), "\\x%02x", (unsigned int)(buf[i] & 0xff)); j = strlen(buf2); } |