From 0b08dbfdd0aaf9108a09b011fc2863964e6ccf4c Mon Sep 17 00:00:00 2001 From: aaa945260 Date: Thu, 16 Feb 2017 18:12:04 +0800 Subject: [PATCH] spool file with 0x8200 --- tests/captdefilter.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/captdefilter.c b/tests/captdefilter.c index 8f113c0..4e6e8da 100644 --- a/tests/captdefilter.c +++ b/tests/captdefilter.c @@ -99,7 +99,11 @@ static void decode_hiscoa_band(const uint8_t *buf, size_t size) unsigned lines = WORD(buf[2], buf[3]); decode_hiscoa_band_data(buf + 4, size - 4, lines); } - +static void decode_hiscoa_band2(const uint8_t *buf, size_t size) +{ + unsigned lines = WORD_(buf[2], buf[3]); + decode_hiscoa_band_data(buf + 8, size - 8, lines); +} static void dispatch(uint16_t cmd, const uint8_t *buf, size_t size) { switch (cmd) { @@ -140,11 +144,15 @@ static void dispatch(uint16_t cmd, const uint8_t *buf, size_t size) } break; case 0x8000: - case 0x8200: fprintf(stderr, " -(Hi-SCoA data)-\n"); dump(buf, 4); decode_hiscoa_band(buf, size); break; + case 0x8200: + fprintf(stderr, " -(Hi-SCoA data 0x8200)-\n"); + dump(buf, 4); + decode_hiscoa_band2(buf, size); + break; case 0xC0A4: fprintf(stderr, " --end--\n"); page_output(); @@ -195,6 +203,8 @@ int main(int argc, char **argv) len = WORD(buf[6], buf[7]); len <<= 16; len += WORD(buf[4], buf[5]); + pos=0; + fseek(input, -8, SEEK_CUR); break; default: len = WORD(buf[2], buf[3]);