From 2d8d23d433f2f4873bc61376f69bec0b57910ae0 Mon Sep 17 00:00:00 2001 From: "sander.hagendoorn" Date: Mon, 27 Dec 2021 13:49:30 +0100 Subject: [PATCH] Regards #77: MISRA-C:2004 Rule 16.9: A function identifier shall only be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty. --- src/printf/printf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/printf/printf.c b/src/printf/printf.c index 9a4266c2..857d8469 100644 --- a/src/printf/printf.c +++ b/src/printf/printf.c @@ -821,7 +821,7 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const if (!buffer) { // use null output function - out = out_discard; + out = &out_discard; } while (*format) @@ -1118,7 +1118,7 @@ int printf_(const char* format, ...) va_list va; va_start(va, format); char buffer[1]; - const int ret = _vsnprintf(out_putchar, buffer, (size_t)-1, format, va); + const int ret = _vsnprintf(&out_putchar, buffer, (size_t)-1, format, va); va_end(va); return ret; } @@ -1147,7 +1147,7 @@ int snprintf_(char* buffer, size_t count, const char* format, ...) int vprintf_(const char* format, va_list va) { char buffer[1]; - return _vsnprintf(out_putchar, buffer, (size_t)-1, format, va); + return _vsnprintf(&out_putchar, buffer, (size_t)-1, format, va); } int vsprintf_(char* buffer, const char* format, va_list va)