remove a static analyzer warning from botl.c
One static analyzer warned that there was a lower bound range check ahead of the array index, but no upper bound check.
This commit is contained in:
+3
-2
@@ -1217,8 +1217,9 @@ eval_notify_windowport_field(int fld, boolean *valsetlist, int idx)
|
|||||||
|| (fld == BL_HP && iflags.wc2_hitpointbar)) {
|
|| (fld == BL_HP && iflags.wc2_hitpointbar)) {
|
||||||
fldmax = curr->idxmax;
|
fldmax = curr->idxmax;
|
||||||
pc = (fldmax == BL_EXP) ? exp_percentage()
|
pc = (fldmax == BL_EXP) ? exp_percentage()
|
||||||
: (fldmax >= 0) ? percentage(curr, &gb.blstats[idx][fldmax])
|
: (fldmax >= 0 && fldmax < MAXBLSTATS)
|
||||||
: 0; /* bullet proofing; can't get here */
|
? percentage(curr, &gb.blstats[idx][fldmax])
|
||||||
|
: 0; /* bullet proofing; can't get here */
|
||||||
if (pc != prev->percent_value)
|
if (pc != prev->percent_value)
|
||||||
chg = 1;
|
chg = 1;
|
||||||
curr->percent_value = pc;
|
curr->percent_value = pc;
|
||||||
|
|||||||
Reference in New Issue
Block a user