[Scummvm-cvs-logs] SF.net SVN: scummvm:[53495] scummvm/trunk/engines/cruise

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Oct 15 16:14:33 CEST 2010


Revision: 53495
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53495&view=rev
Author:   lordhoto
Date:     2010-10-15 14:14:33 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
CRUISE: Replace some strncpy with strlcpy.

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/function.cpp

Modified: scummvm/trunk/engines/cruise/background.cpp
===================================================================
--- scummvm/trunk/engines/cruise/background.cpp	2010-10-15 14:14:10 UTC (rev 53494)
+++ scummvm/trunk/engines/cruise/background.cpp	2010-10-15 14:14:33 UTC (rev 53495)
@@ -216,8 +216,7 @@
 		if (strlen(name) >= sizeof(backgroundTable[idx].name)) 
 			warning("background name length exceeded allowable maximum");
 
-		strncpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name));
-		backgroundTable[idx].name[sizeof(backgroundTable[idx].name) - 1] = 0;
+		Common::strlcpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name));
 	}
 
 	return (0);

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2010-10-15 14:14:10 UTC (rev 53494)
+++ scummvm/trunk/engines/cruise/function.cpp	2010-10-15 14:14:33 UTC (rev 53495)
@@ -58,7 +58,7 @@
 
 	updateAllScriptsImports();
 
-	strncpy(nextOverlay, overlayName, 38);
+	Common::strlcpy(nextOverlay, overlayName, sizeof(nextOverlay));
 
 	return overlayLoadResult;
 }


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