>From df6cd13e7d39761c2d408eff980816b7179af5dd Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Fri, 20 Jul 2012 10:42:27 +0200 Subject: [PATCH] calc_stat.c: more verbose stderr output for non-ascii characters --- src/calc_stat.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calc_stat.c b/src/calc_stat.c index 8105bad..7898372 100644 --- a/src/calc_stat.c +++ b/src/calc_stat.c @@ -82,12 +82,18 @@ int main(int argc, char * * argv) np = 0; if(C2I(ligne[i])<32) { - if (!npflag) fprintf(stderr, "Warning, non printable character line %d : %s\n", nb_lignes, ligne); + if (!npflag) + fprintf(stderr, + "Warning, non printable character 0x%02x line %d offset %d: %s\n", + (unsigned char)ligne[i], nb_lignes, i, ligne); np += 1; } if(C2I(ligne[i])>127) { - if (!npflag) fprintf(stderr, "Warning, non US ascii character line %d : %s\n", nb_lignes, ligne); + if (!npflag) + fprintf(stderr, + "Warning, non US ascii character 0x%02x line %d offset %d: %s\n", + (unsigned char)ligne[i], nb_lignes, i, ligne); np += 1; } if((i>0) && (C2I(ligne[i-1])<32)) -- 1.7.7.6