aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-04-06 18:26:33 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-04-06 18:26:33 +0200
commit2ab994f7079daa052f8816b72e215e1609d41f76 (patch)
tree327d8bbe704fec424f8842471873ff41b8c15729 /libbb
parentf5018dac21df54647d0982ed4bebd0286d77cc56 (diff)
downloadbusybox-2ab994f7079daa052f8816b72e215e1609d41f76.tar.gz
placate gcc-8.0.1 warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/dump.c6
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 =
"\v" "\\""v""\0"
;
-
static void conv_c(PR *pr, unsigned char *p)
{
const char *str = conv_str;
- char buf[10];
do {
if (*p == *str) {
@@ -482,7 +480,9 @@ static void conv_c(PR *pr, unsigned char *p)
*pr->cchar = 'c';
printf(pr->fmt, *p);
} else {
- sprintf(buf, "%03o", (int) *p);
+ char buf[4];
+ /* gcc-8.0.1 needs lots of casts to shut up */
+ sprintf(buf, "%03o", (unsigned)(uint8_t)*p);
str = buf;
strpr:
*pr->cchar = 's';