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) | |
download | busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.tar.gz busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.tar.bz2 busybox-w32-8684cbb5cc2c461e3795fba19ad7386db37cf499.zip |
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) | |||
492 | str += 4; | 492 | str += 4; |
493 | } while (*str); | 493 | } while (*str); |
494 | 494 | ||
495 | if (isprint(*p)) { | 495 | if (isprint_asciionly(*p)) { |
496 | *pr->cchar = 'c'; | 496 | *pr->cchar = 'c'; |
497 | printf(pr->fmt, *p); | 497 | printf(pr->fmt, *p); |
498 | } else { | 498 | } else { |
499 | sprintf(buf, "%03o", (int) *p); | 499 | sprintf(buf, "%03o", (int) *p); |
500 | str = buf; | 500 | str = buf; |
501 | strpr: | 501 | strpr: |
502 | *pr->cchar = 's'; | 502 | *pr->cchar = 's'; |
503 | printf(pr->fmt, str); | 503 | printf(pr->fmt, str); |
504 | } | 504 | } |
@@ -519,7 +519,7 @@ static void conv_u(PR *pr, unsigned char *p) | |||
519 | } else if (*p == 0x7f) { | 519 | } else if (*p == 0x7f) { |
520 | *pr->cchar = 's'; | 520 | *pr->cchar = 's'; |
521 | printf(pr->fmt, "del"); | 521 | printf(pr->fmt, "del"); |
522 | } else if (isprint(*p)) { | 522 | } else if (*p < 0x7f) { /* isprint() */ |
523 | *pr->cchar = 'c'; | 523 | *pr->cchar = 'c'; |
524 | printf(pr->fmt, *p); | 524 | printf(pr->fmt, *p); |
525 | } else { | 525 | } else { |
@@ -609,7 +609,7 @@ static void display(priv_dumper_t* dumper) | |||
609 | break; | 609 | break; |
610 | } | 610 | } |
611 | case F_P: | 611 | case F_P: |
612 | printf(pr->fmt, isprint(*bp) ? *bp : '.'); | 612 | printf(pr->fmt, isprint_asciionly(*bp) ? *bp : '.'); |
613 | break; | 613 | break; |
614 | case F_STR: | 614 | case F_STR: |
615 | printf(pr->fmt, (char *) bp); | 615 | printf(pr->fmt, (char *) bp); |