aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/saga/sfuncs.cpp4
-rw-r--r--engines/scumm/he/logic_he.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index a274983de1..9d298818cd 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1570,9 +1570,9 @@ void Script::sfStub(const char *name, ScriptThread *thread, int nArgs) {
for (int i = 0; i < nArgs; i++) {
snprintf(buf1, 100, "%d", thread->pop());
- strncat(buf, buf1, 256);
+ strncat(buf, buf1, sizeof(buf) - strlen(buf) - 1);
if (i + 1 < nArgs)
- strncat(buf, ", ", 256);
+ strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
}
debug(0, "%s)", buf);
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index f7f4c1effc..9efb1c697c 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -86,9 +86,9 @@ int32 LogicHE::dispatch(int op, int numArgs, int32 *args) {
for (int i = 1; i < numArgs; i++) {
snprintf(tmp, 32, ", %d", args[i]);
- strncat(str, tmp, 256);
+ strncat(str, tmp, sizeof(str) - strlen(str) - 1);
}
- strncat(str, "])", 256);
+ strncat(str, "])", sizeof(str) - strlen(str) - 1);
debug(0, "%s", str);
#else