Fix display of hex char literals in device tree source format

The format specifier PRIx8 for unsigned integers was used with a
signed character, yielding unexpected results with values >= 0x7F.
This commit is contained in:
StekiKun 2022-07-16 12:20:26 +02:00
parent c001fc01a4
commit bac9d17dbc

View file

@ -93,7 +93,7 @@ static void write_propval_string(FILE *f, const char *s, size_t len)
if (isprint((unsigned char)c))
fprintf(f, "%c", c);
else
fprintf(f, "\\x%02"PRIx8, c);
fprintf(f, "\\x%02"PRIx8, (unsigned char)c);
}
}
fprintf(f, "\"");