685137d5f5
If no character matches the typed character, the loop should exit when `lb->citem == cc`, which should happen after every entry is visited once. However, if no item is selected, `lb->citem == -1`, and `cc` is never `-1`, so the exit path never triggers. Rewrite the loop to be bounded by number of steps, rather than bounded by returning to a particular offset. This also protects against undefined behavior if the menu had zero elements. |
||
---|---|---|
common | ||
contrib | ||
d1x-rebirth | ||
d2x-rebirth | ||
Documentation | ||
similar | ||
.gitattributes | ||
.gitignore | ||
COPYING.txt | ||
GPL-3.txt | ||
INSTALL.markdown | ||
ISSUE_TEMPLATE.md | ||
SConstruct |