aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/dialogs
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-01 22:35:14 -0400
committerPaul Gilbert2018-04-01 22:35:14 -0400
commit0cde83ea01cfa1bfd3253bcfa3a7af0b7af5ad02 (patch)
tree66249b8aa425e624c57bab1085eccd4ac4731bad /engines/xeen/dialogs
parent388f55b85791a5a5c9666c7429e27532dfd41d3c (diff)
downloadscummvm-rg350-0cde83ea01cfa1bfd3253bcfa3a7af0b7af5ad02.tar.gz
scummvm-rg350-0cde83ea01cfa1bfd3253bcfa3a7af0b7af5ad02.tar.bz2
scummvm-rg350-0cde83ea01cfa1bfd3253bcfa3a7af0b7af5ad02.zip
XEEN: Fix Coverity reported overruns
Diffstat (limited to 'engines/xeen/dialogs')
-rw-r--r--engines/xeen/dialogs/dialogs_quests.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/xeen/dialogs/dialogs_quests.cpp b/engines/xeen/dialogs/dialogs_quests.cpp
index 8f8ebe785d..239793ee8c 100644
--- a/engines/xeen/dialogs/dialogs_quests.cpp
+++ b/engines/xeen/dialogs/dialogs_quests.cpp
@@ -45,6 +45,7 @@ void Quests::execute() {
bool headerShown = false;
int topRow = 0;
const char **questItems = (g_vm->getGameID() == GType_Swords) ? Res.QUEST_ITEM_NAMES_SWORDS : Res.QUEST_ITEM_NAMES;
+ int itemsCount = (g_vm->getGameID() == GType_Swords) ? TOTAL_QUEST_ITEMS_SWORDS : TOTAL_QUEST_ITEMS;
addButtons();
loadQuestNotes();
@@ -67,12 +68,12 @@ void Quests::execute() {
switch (mode) {
case QUEST_ITEMS:
- for (int idx = 0; idx < TOTAL_QUEST_ITEMS; ++idx)
+ for (int idx = 0; idx < itemsCount; ++idx)
lines[idx] = "\b \b*";
count = 0;
headerShown = false;
- for (int idx = 0; idx < TOTAL_QUEST_ITEMS; ++idx) {
+ for (int idx = 0; idx < itemsCount; ++idx) {
if (party._questItems[idx]) {
if (!count && !headerShown && idx < 35) {
lines[count++] = Res.CLOUDS_OF_XEEN_LINE;
@@ -116,7 +117,7 @@ void Quests::execute() {
break;
case CURRENT_QUESTS:
- for (int idx = 0; idx < TOTAL_QUEST_ITEMS; ++idx)
+ for (int idx = 0; idx < itemsCount; ++idx)
lines[idx] = "";
count = 0;