From 14788b3fe36f9acb760dcfed32cf0835adec81c0 Mon Sep 17 00:00:00 2001 From: Robert Konklewski Date: Thu, 14 Apr 2016 15:19:54 +0200 Subject: [PATCH] sersendf.c: fix printing signed 16-bit values. The function converted int16_t to unsigned before printing it, resulting in integer overflow. --- sersendf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sersendf.c b/sersendf.c index 4b9d24b..162ce2d 100644 --- a/sersendf.c +++ b/sersendf.c @@ -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;