diff options
Diffstat (limited to 'libbb/dump.c')
-rw-r--r-- | libbb/dump.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index db91fcfe7..5941ef902 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -464,11 +464,9 @@ static const char conv_str[] ALIGN1 = | |||
464 | "\v" "\\""v""\0" | 464 | "\v" "\\""v""\0" |
465 | ; | 465 | ; |
466 | 466 | ||
467 | |||
468 | static void conv_c(PR *pr, unsigned char *p) | 467 | static void conv_c(PR *pr, unsigned char *p) |
469 | { | 468 | { |
470 | const char *str = conv_str; | 469 | const char *str = conv_str; |
471 | char buf[10]; | ||
472 | 470 | ||
473 | do { | 471 | do { |
474 | if (*p == *str) { | 472 | if (*p == *str) { |
@@ -482,7 +480,9 @@ static void conv_c(PR *pr, unsigned char *p) | |||
482 | *pr->cchar = 'c'; | 480 | *pr->cchar = 'c'; |
483 | printf(pr->fmt, *p); | 481 | printf(pr->fmt, *p); |
484 | } else { | 482 | } else { |
485 | sprintf(buf, "%03o", (int) *p); | 483 | char buf[4]; |
484 | /* gcc-8.0.1 needs lots of casts to shut up */ | ||
485 | sprintf(buf, "%03o", (unsigned)(uint8_t)*p); | ||
486 | str = buf; | 486 | str = buf; |
487 | strpr: | 487 | strpr: |
488 | *pr->cchar = 's'; | 488 | *pr->cchar = 's'; |