aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/st_vocab.cpp2
-rw-r--r--engines/titanic/true_talk/tt_string_node.cpp4
-rw-r--r--engines/titanic/true_talk/tt_string_node.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 5135f6466e..a4f5cd851d 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -145,7 +145,7 @@ TTword *STVocab::findWord(const TTString &str) {
bool flag = false;
TTword *word = _pHead;
- while (!flag) {
+ while (word && !flag) {
if (_field18 != 3 || strcmp(word->c_str(), str)) {
if (word->scanCopy(str, tempNode, _field18))
word = word->_pNext;
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index b3d3707ee5..95b6465137 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -84,9 +84,9 @@ void TTstringNode::detach() {
_pNext->_pPrior = _pPrior;
}
-TTstringNode *TTstringNode::getTail() const {
+TTstringNode *TTstringNode::getTail() {
if (_pNext == nullptr)
- return nullptr;
+ return this;
TTstringNode *node = _pNext;
while (node->_pNext)
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index f836889f43..2c6a4e148d 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -32,7 +32,7 @@ private:
/**
* Returns the final node at the end of the linked list of nodes
*/
- TTstringNode *getTail() const;
+ TTstringNode *getTail();
protected:
/**
* Initializes state for the node