curses static analyzer bits

This is mostly just adding some Null guards ahead of
code that was already dereferencing pointers, so there
should be no change in behavior.

Also adds one validation of an array index that was
drawing a complaint.
This commit is contained in:
nhmall
2023-12-29 10:38:37 -05:00
parent bed3b1d667
commit 9d32956616
3 changed files with 25 additions and 21 deletions
+1
View File
@@ -397,6 +397,7 @@ curses_str_remainder(const char *str, int width, int line_num)
if (last_space == 0) { /* No spaces found */
last_space = count - 1;
}
assert(IndexOk(last_space, substr));
if (substr[last_space] == '\0') {
break;
}