[Scummvm-cvs-logs] SF.net SVN: scummvm: [23149] scummvm/trunk/engines/saga/actor.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Fri Jun 16 21:34:27 CEST 2006


Revision: 23149
Author:   sev
Date:     2006-06-16 12:34:16 -0700 (Fri, 16 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23149&view=rev

Log Message:
-----------
Fix gcc warning.

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.cpp
Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp	2006-06-16 18:41:24 UTC (rev 23148)
+++ scummvm/trunk/engines/saga/actor.cpp	2006-06-16 19:34:16 UTC (rev 23149)
@@ -1797,14 +1797,13 @@
 	char *outputString;
 
 	backBuffer = _vm->_gfx->getBackBuffer();
+	stringLength = strlen(_activeSpeech.strings[0]);
+	outputString = (char*)calloc(stringLength + 1, 1);
 
-	if (_activeSpeech.speechFlags & kSpeakSlow) {
-		stringLength = strlen(_activeSpeech.strings[0]);
-		outputString = (char*)calloc(stringLength + 1, 1);
+	if (_activeSpeech.speechFlags & kSpeakSlow)
 		strncpy(outputString, _activeSpeech.strings[0], _activeSpeech.slowModeCharIndex + 1);
-	} else {
-		outputString = (char*)_activeSpeech.strings[0];
-	}
+	else
+		strncpy(outputString, _activeSpeech.strings[0], stringLength);
 
 	if (_activeSpeech.actorsCount > 1) {
 		height = _vm->_font->getHeight(kKnownFontScript);
@@ -1824,9 +1823,8 @@
 		_vm->_font->textDrawRect(kKnownFontScript, backBuffer, outputString, _activeSpeech.drawRect, _activeSpeech.speechColor[0],
 			_activeSpeech.outlineColor[0], _activeSpeech.getFontFlags(0));
 	}
-	if (_activeSpeech.speechFlags & kSpeakSlow) {
-		free(outputString);
-	}
+
+	free(outputString);
 }
 
 bool Actor::followProtagonist(ActorData *actor) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list