From 780d620175ae5ab900c2c558fb747d95bca09f19 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 27 Jan 2014 11:57:30 +0100 Subject: Output last corrupted data --- src/ufodecode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/ufodecode.c') diff --git a/src/ufodecode.c b/src/ufodecode.c index 492be74..03c4404 100644 --- a/src/ufodecode.c +++ b/src/ufodecode.c @@ -587,8 +587,19 @@ size_t ufo_decoder_decode_frame(UfoDecoder *decoder, return 0; } - if (err) + if (err) { + fprintf(stderr, "Corrupt data:"); + + for (int i = 0; i < pos; i++) { + if ((i % 8) == 0) + fprintf(stderr, "\n"); + + fprintf(stderr, " %#08x", raw[i]); + } + + fprintf(stderr, "\n"); return 0; + } #else switch (version) { case 0: -- cgit v1.2.3