[Scummvm-cvs-logs] SF.net SVN: scummvm:[53148] scummvm/trunk/engines/agi/predictive.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Mon Oct 11 19:52:46 CEST 2010


Revision: 53148
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53148&view=rev
Author:   wjpalenstijn
Date:     2010-10-11 17:52:44 +0000 (Mon, 11 Oct 2010)

Log Message:
-----------
AGI: Fix one more strncpy/strncat issue

Modified Paths:
--------------
    scummvm/trunk/engines/agi/predictive.cpp

Modified: scummvm/trunk/engines/agi/predictive.cpp
===================================================================
--- scummvm/trunk/engines/agi/predictive.cpp	2010-10-11 17:07:53 UTC (rev 53147)
+++ scummvm/trunk/engines/agi/predictive.cpp	2010-10-11 17:52:44 UTC (rev 53148)
@@ -210,13 +210,12 @@
 				}
 			}
 
-			temp[MAXWORDLEN] = 0;
+			Common::strlcpy(temp, prefix.c_str(), sizeof(temp));
+			Common::strlcat(temp, _currentWord.c_str(), sizeof(temp));
 
-			strncpy(temp, prefix.c_str(), MAXWORDLEN);
-			strncat(temp, _currentWord.c_str(), MAXWORDLEN);
-
 			for (int i = prefix.size() + _currentCode.size(); i < MAXWORDLEN; i++)
 				temp[i] = ' ';
+			temp[MAXWORDLEN] = 0;
 
 			printText(temp, 0, 8, 7, MAXWORDLEN, 15, 0);
 			_gfx->flushBlock(62, 54, 249, 66);


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