[Scummvm-git-logs] scummvm master -> 8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3

dreammaster dreammaster at scummvm.org
Thu Nov 3 02:31:34 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8abe97dfda TITANIC: Parser fixes


Commit: 8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3
    https://github.com/scummvm/scummvm/commit/8abe97dfdad1fc9b44bded185ff5c5a00fa2f2d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-02T21:31:14-04:00

Commit Message:
TITANIC: Parser fixes

Changed paths:
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/tt_concept_node.cpp
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_string.cpp



diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 0790673..bfa97e3 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -40,7 +40,8 @@ void CTitleEngine::setup(int val1, int val2) {
 
 /*------------------------------------------------------------------------*/
 
-STtitleEngine::STtitleEngine(): CTitleEngine(), _responseP(nullptr) {
+STtitleEngine::STtitleEngine(): CTitleEngine(),
+		_responseP(nullptr), _stream(nullptr) {
 }
 
 STtitleEngine::~STtitleEngine() {
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index 454ca59..f6512b3 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -29,11 +29,14 @@ namespace Titanic {
 TTconceptNode::TTconceptNode() : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
 		_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
 		_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
+	Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr);
 }
 
 TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
 		_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
 		_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
+	Common::fill(&_concepts[0], &_concepts[6], (TTconcept *)nullptr);
+
 	if (src._status) {
 		_status = SS_5;
 	} else {
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index d67f523..dc05621 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -489,7 +489,7 @@ int TTparser::findFrames(TTsentence *sentence) {
 			break;
 
 		TTword *srcWord = nullptr;
-		TTword *word = _owner->_vocab->getWord(wordString, &word);
+		TTword *word = _owner->_vocab->getWord(wordString, &srcWord);
 		sentence->storeVocabHit(srcWord);
 
 		if (!word && ctr == 1) {
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 198a8c2..43910fc 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -111,7 +111,7 @@ TTstring TTstring::tokenize(const char *delim) {
 	const char *strP = _data->_string.c_str();
 	const char *splitP = nullptr, *chP;
 
-	for (const char *d = delim; d; ++d) {
+	for (const char *d = delim; *d; ++d) {
 		chP = strchr(strP, *d);
 		if (chP && (splitP == nullptr || chP < splitP))
 			splitP = chP;
@@ -122,7 +122,9 @@ TTstring TTstring::tokenize(const char *delim) {
 		_data->_string = CString(splitP + 1);
 		return result;
 	} else {
-		return TTstring();
+		TTstring result(strP);
+		_data->_string = CString();
+		return result;
 	}
 }
 





More information about the Scummvm-git-logs mailing list