Do not confuse code analyzers with out-of-bounds array access look alike

The code is only getting the address, but we might be performing an
addressing that is out-of-bounds. Avoid it and use the address form
instead.

Warned-by: cppcheck (objectIndex)
This commit is contained in:
Guillem Jover 2023-11-14 19:09:25 +01:00
parent a44f885cd4
commit 459b7f7d24

View File

@ -284,7 +284,7 @@ setproctitle_impl(const char *fmt, ...)
if (nul < SPT.nul) {
*SPT.nul = '.';
} else if (nul == SPT.nul && &nul[1] < SPT.end) {
} else if (nul == SPT.nul && (nul + 1) < SPT.end) {
*SPT.nul = ' ';
*++nul = '\0';
}