From 78df665ca0f29f274dc4efb74e934b290a9d2812 Mon Sep 17 00:00:00 2001 From: cinsights Date: Sat, 16 Jan 2021 03:23:48 +0000 Subject: [PATCH] Fix bug 1140 - chsnprintf() sign mode/filler mode conflict git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14018 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/lib/streams/chprintf.c | 2 +- readme.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/os/hal/lib/streams/chprintf.c b/os/hal/lib/streams/chprintf.c index 33134da96..4ecec7bcf 100644 --- a/os/hal/lib/streams/chprintf.c +++ b/os/hal/lib/streams/chprintf.c @@ -315,7 +315,7 @@ unsigned_common: width = -width; } if (width < 0) { - if (*s == '-' && filler == '0') { + if ((*s == '-' || *s == '+') && filler == '0') { streamPut(chp, (uint8_t)*s++); n++; i--; diff --git a/readme.txt b/readme.txt index 4bc848cfe..1c64d9b7a 100644 --- a/readme.txt +++ b/readme.txt @@ -74,6 +74,7 @@ ***************************************************************************** *** Next *** +- FIX: Fixed chsnprintf() sign mode/filler mode conflict (bug #1140) - NEW: Added time conversion macros and functions for monotonic time stamps - NEW: Added support for STM32WB55. - NEW: Added chscanf() and buffered streams, contributed by Alex Lewontin.