diff options
author | Marco Paland <marco@paland.com> | 2019-01-16 10:44:13 +0100 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2019-01-16 10:44:13 +0100 |
commit | c013a0e8d6bb57247074c748a05bbe7f43bdec6f (patch) | |
tree | 09e806a56f9128c913c0925ef99d8ba5fb156d19 /printf.c | |
parent | d974b16eacb5bdfdbbecf15d512a68c1bc23c743 (diff) | |
download | printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.tar.gz printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.tar.bz2 printf-c013a0e8d6bb57247074c748a05bbe7f43bdec6f.zip |
fix(printf): fctprintf() must not append null terminator
Fixes #39, references #19
Diffstat (limited to 'printf.c')
-rw-r--r-- | printf.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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);
+ }
}
|