From: Adam Dickmeiss Date: Mon, 21 May 2012 12:49:08 +0000 (+0200) Subject: Change APDU dump printing to avoid long leading blanks X-Git-Tag: v4.2.34~15 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=d02429b9a7fb8bb01961a51c2446eb1dce048c78;hp=1e05a7181484150177da75a3a2fb43562d2c7520 Change APDU dump printing to avoid long leading blanks 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. --- diff --git a/src/odr_util.c b/src/odr_util.c index 22a6691..644c3c3 100644 --- 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)