lib/os/cbprintf: Use signed char for %hhd format
The cast to narrow for %hhd support must be 'signed char' instead of 'char' to support targets where 'char' is unsigned, as on riscv. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
e097d95c66
commit
11267a30a1
1 changed files with 1 additions and 1 deletions
|
@ -1514,7 +1514,7 @@ int z_cbvprintf_impl(cbprintf_cb out, void *ctx, const char *fp,
|
|||
break;
|
||||
}
|
||||
if (length_mod == LENGTH_HH) {
|
||||
value->sint = (char)value->sint;
|
||||
value->sint = (signed char)value->sint;
|
||||
} else if (length_mod == LENGTH_H) {
|
||||
value->sint = (short)value->sint;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue