From c013a0e8d6bb57247074c748a05bbe7f43bdec6f Mon Sep 17 00:00:00 2001 From: Marco Paland Date: Wed, 16 Jan 2019 10:44:13 +0100 Subject: fix(printf): fctprintf() must not append null terminator Fixes #39, references #19 --- printf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'printf.c') diff --git a/printf.c b/printf.c index df88d3d..c9a1175 100644 --- a/printf.c +++ b/printf.c @@ -134,8 +134,10 @@ static inline void _out_char(char character, void* buffer, size_t idx, size_t ma static inline void _out_fct(char character, void* buffer, size_t idx, size_t maxlen) { (void)idx; (void)maxlen; - // buffer is the output fct pointer - ((out_fct_wrap_type*)buffer)->fct(character, ((out_fct_wrap_type*)buffer)->arg); + if (character) { + // buffer is the output fct pointer + ((out_fct_wrap_type*)buffer)->fct(character, ((out_fct_wrap_type*)buffer)->arg); + } } -- cgit v1.2.3