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:
Robert Konklewski 2016-04-14 15:19:54 +02:00 committed by Markus Hitter
parent 9a731c83dc
commit 14788b3fe3
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ void sersendf_P(PGM_P format_P, ...) {
if (j == 1) if (j == 1)
serwrite_int8((int8_t)GET_ARG(int16_t)); serwrite_int8((int8_t)GET_ARG(int16_t));
else if (j == 2) else if (j == 2)
serwrite_int16((uint16_t)GET_ARG(int16_t)); serwrite_int16((int16_t)GET_ARG(int16_t));
else else
serwrite_int32(GET_ARG(int32_t)); serwrite_int32(GET_ARG(int32_t));
j = 0; j = 0;