projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e05a71
)
Change APDU dump printing to avoid long leading blanks
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 21 May 2012 12:49:08 +0000
(14:49 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 21 May 2012 12:49:08 +0000
(14:49 +0200)
For levels 16 or larger the level is shown and the indentation is
truncated but recursed with modula 8. This makes it still reasonable
easy to read - even for nested BER dumps.
src/odr_util.c
patch
|
blob
|
history
diff --git
a/src/odr_util.c
b/src/odr_util.c
index
22a6691
..
644c3c3
100644
(file)
--- a/
src/odr_util.c
+++ b/
src/odr_util.c
@@
-17,10
+17,13
@@
void odr_prname(ODR o, const char *name)
{
- if (name)
- odr_printf(o, "%*s%s ", o->op->indent*4, "", name);
+ if (o->op->indent < 16)
+ odr_printf(o, "%*s", o->op->indent * 2, "");
else
- odr_printf(o, "%*s", o->op->indent*4, "");
+ odr_printf(o, "level=%-7d%*s", o->op->indent,
+ 2 * (o->op->indent % 8) , "");
+ if (name)
+ odr_printf(o, "%s ", name);
}
int odp_more_chunks(ODR o, const unsigned char *base, int len)