sersendf.c: fix printing signed 16-bit values.
The function converted int16_t to unsigned before printing it, resulting in integer overflow.
This commit is contained in:
parent
9a731c83dc
commit
14788b3fe3
|
|
@ -73,7 +73,7 @@ void sersendf_P(PGM_P format_P, ...) {
|
|||
if (j == 1)
|
||||
serwrite_int8((int8_t)GET_ARG(int16_t));
|
||||
else if (j == 2)
|
||||
serwrite_int16((uint16_t)GET_ARG(int16_t));
|
||||
serwrite_int16((int16_t)GET_ARG(int16_t));
|
||||
else
|
||||
serwrite_int32(GET_ARG(int32_t));
|
||||
j = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue