summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-01-27 11:57:30 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-01-27 11:57:30 +0100
commit780d620175ae5ab900c2c558fb747d95bca09f19 (patch)
tree8e04f69f4128ee8d4134e45bed9eb9408aeb6421 /src
parent8a56439d340c1a6324d32a1ed0d10d780c710ffa (diff)
downloadlibufodecode-780d620175ae5ab900c2c558fb747d95bca09f19.tar.gz
libufodecode-780d620175ae5ab900c2c558fb747d95bca09f19.tar.bz2
libufodecode-780d620175ae5ab900c2c558fb747d95bca09f19.tar.xz
libufodecode-780d620175ae5ab900c2c558fb747d95bca09f19.zip
Output last corrupted data
Diffstat (limited to 'src')
-rw-r--r--src/ufodecode.c13
1 files changed, 12 insertions, 1 deletions
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: