From d567cca1de689fb08da3557f81e7cae34257e438 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Apr 2023 16:29:45 +0200 Subject: checksrc: fix SPACEBEFOREPAREN for conditions starting with "*" The open paren check wants to warn for spaces before open parenthesis for if/while/for but also for any function call. In order to avoid catching function pointer declarations, the logic allows a space if the first character after the open parenthesis is an asterisk. I also spotted what we did not include "switch" in the check but we should. This check is a little lame, but we reduce this problem by not allowing that space for if/while/for/switch. Reported-by: Emanuele Torre Closes #11044 --- lib/mprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/mprintf.c') diff --git a/lib/mprintf.c b/lib/mprintf.c index 5de935b1f..8e830438d 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -400,7 +400,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto, /* out of allowed range */ return 1; - switch (*fmt) { + switch(*fmt) { case 'S': flags |= FLAGS_ALT; /* FALLTHROUGH */ -- cgit v1.2.1