diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-18 11:34:43 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-18 11:34:43 +0100 |
commit | 8684cbb5cc2c461e3795fba19ad7386db37cf499 (patch) | |
tree | 027d4aa55cfa710769c86c2aca838fbba3e3dbe9 /libbb | |
parent | 5b0a7f1a6e66af3f1ff4159d4eb96c30517782b8 (diff) |
libbb: robustify isXXXX(). +39 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/dump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index bef485eff..49e5e26f8 100644 --- a/libbb/dump.c +++ b/libbb/dump.c @@ -492,13 +492,13 @@ static void conv_c(PR *pr, unsigned char *p) str += 4; } while (*str); - if (isprint(*p)) { + if (isprint_asciionly(*p)) { *pr->cchar = 'c'; printf(pr->fmt, *p); } else { sprintf(buf, "%03o", (int) *p); str = buf; - strpr: + strpr: *pr->cchar = 's'; printf(pr->fmt, str); } @@ -519,7 +519,7 @@ static void conv_u(PR *pr, unsigned char *p) } else if (*p == 0x7f) { *pr->cchar = 's'; printf(pr->fmt, "del"); - } else if (isprint(*p)) { + } else if (*p < 0x7f) { /* isprint() */ *pr->cchar = 'c'; printf(pr->fmt, *p); } else { @@ -609,7 +609,7 @@ static void display(priv_dumper_t* dumper) break; } case F_P: - printf(pr->fmt, isprint(*bp) ? *bp : '.'); + printf(pr->fmt, isprint_asciionly(*bp) ? *bp : '.'); break; case F_STR: printf(pr->fmt, (char *) bp); |