Skip to content

Commit

Permalink
Regards mpaland#77: MISRA-C:2004 Rule 16.9: A function identifier sha…
Browse files Browse the repository at this point in the history
…ll only be used with either a preceding `&`, or with a parenthesized parameter list, which may be empty.
  • Loading branch information
sander.hagendoorn authored and eyalroz committed Feb 21, 2022
1 parent 6a34f05 commit 2d8d23d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/printf/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2d8d23d

Please sign in to comment.