aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tinsel/dialogs.cpp')
-rw-r--r--engines/tinsel/dialogs.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index a84dad942c..b5d090ec15 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -1671,10 +1671,10 @@ static void Select(int i, bool force) {
#else
// Current description with cursor appended
if (cd.box[i].boxText != NULL) {
- strcpy(g_sedit, cd.box[i].boxText);
- strcat(g_sedit, sCursor);
+ Common::strlcpy(g_sedit, cd.box[i].boxText, SG_DESC_LEN+2);
+ Common::strlcat(g_sedit, sCursor, SG_DESC_LEN+2);
} else {
- strcpy(g_sedit, sCursor);
+ Common::strlcpy(g_sedit, sCursor, SG_DESC_LEN+2);
}
#endif
@@ -3676,13 +3676,13 @@ extern void HideConversation(bool bHide) {
ConstructInventory(FULL);
else {
// Move it all back on-screen
- for (i = 0; g_objArray[i] && i < MAX_WCOMP; i++) {
+ for (i = 0; i < MAX_WCOMP && g_objArray[i]; i++) {
MultiAdjustXY(g_objArray[i], -2 * SCREEN_WIDTH, 0);
}
// Don't flash if items changed. If they have, will be redrawn anyway.
if (TinselV2 || !g_ItemsChanged) {
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++) {
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++) {
MultiAdjustXY(g_iconArray[i], -2*SCREEN_WIDTH, 0);
}
}
@@ -3739,10 +3739,10 @@ extern void HideConversation(bool bHide) {
deltay = g_InvD[INV_CONV].inventoryY - deltay;
// Move it all
- for (i = 0; g_objArray[i] && i < MAX_WCOMP; i++) {
+ for (i = 0; i < MAX_WCOMP && g_objArray[i]; i++) {
MultiMoveRelXY(g_objArray[i], x - center, deltay);
}
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++) {
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++) {
MultiMoveRelXY(g_iconArray[i], x - center, deltay);
}
g_InvD[INV_CONV].inventoryX += x - center;
@@ -3771,10 +3771,10 @@ extern void HideConversation(bool bHide) {
y = 0;
if (x || y) {
- for (i = 0; g_objArray[i] && i < MAX_WCOMP; i++) {
+ for (i = 0; i < MAX_WCOMP && g_objArray[i]; i++) {
MultiMoveRelXY(g_objArray[i], x, y);
}
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++) {
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++) {
MultiMoveRelXY(g_iconArray[i], x, y);
}
g_InvD[INV_CONV].inventoryX += x;
@@ -3786,10 +3786,10 @@ extern void HideConversation(bool bHide) {
*/
if (MultiLowest(g_RectObject) > SCREEN_BOX_HEIGHT2 - SysVar(SV_CONV_MINY)) {
y = (SCREEN_BOX_HEIGHT2 - SysVar(SV_CONV_MINY)) - MultiLowest(g_RectObject);
- for (i = 0; g_objArray[i] && i < MAX_WCOMP; i++) {
+ for (i = 0; i < MAX_WCOMP && g_objArray[i]; i++) {
MultiMoveRelXY(g_objArray[i], 0, y);
}
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++) {
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++) {
MultiMoveRelXY(g_iconArray[i], 0, y);
}
g_InvD[INV_CONV].inventoryY += y;
@@ -4617,9 +4617,9 @@ extern void Xmovement(int x) {
GetAniPosition(g_objArray[0], &g_InvD[g_ino].inventoryX, &aniY);
g_InvD[g_ino].inventoryX +=x;
MultiSetAniX(g_objArray[0], g_InvD[g_ino].inventoryX);
- for (i = 1; g_objArray[i] && i < MAX_WCOMP; i++)
+ for (i = 1; i < MAX_WCOMP && g_objArray[i]; i++)
MultiMoveRelXY(g_objArray[i], x, 0);
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++)
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++)
MultiMoveRelXY(g_iconArray[i], x, 0);
break;
@@ -4665,9 +4665,9 @@ extern void Ymovement(int y) {
GetAniPosition(g_objArray[0], &aniX, &g_InvD[g_ino].inventoryY);
g_InvD[g_ino].inventoryY +=y;
MultiSetAniY(g_objArray[0], g_InvD[g_ino].inventoryY);
- for (i = 1; g_objArray[i] && i < MAX_WCOMP; i++)
+ for (i = 1; i < MAX_WCOMP && g_objArray[i]; i++)
MultiMoveRelXY(g_objArray[i], 0, y);
- for (i = 0; g_iconArray[i] && i < MAX_ICONS; i++)
+ for (i = 0; i < MAX_ICONS && g_iconArray[i]; i++)
MultiMoveRelXY(g_iconArray[i], 0, y);
break;