mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-07 09:48:12 +01:00
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:
parent
a44f885cd4
commit
459b7f7d24
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user