aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/predictive.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 820aad3883..fe92bcd963 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -461,9 +461,8 @@ bool AgiEngine::predictiveDialog() {
}
press:
- strncpy(_predictiveResult, prefix.c_str(), 40);
- strncat(_predictiveResult, _currentWord.c_str(), 40);
- _predictiveResult[prefix.size() + _currentCode.size() + 1] = 0;
+ Common::strlcpy(_predictiveResult, prefix.c_str(), sizeof(_predictiveResult));
+ Common::strlcat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult));
getout:
// if another window was shown, bring it up again