On Mon, 31 Jul 2023 12:19:51 +0100 Valentin Schneider vschneid@redhat.com wrote:
Also, when you do an empty for loop:
for (; str[i] && str[i] != '}'; i++);
Always put the semicolon on the next line, otherwise it is really easy to think that the next line is part of the for loop. That is, instead of the above, do:
for (; str[i] && str[i] != '}'; i++) ;
Interestingly I don't think I've ever encountered that variant, usually having an empty line (which this lacks) and the indentation level is enough to identify these - regardless, I'll change it.
Do a "git grep -B1 -e '^\s*;\s*$'"
You'll find that it is quite common.
Thanks,
-- Steve