[Scummvm-cvs-logs] scummvm master -> 7843acc90783b1d052b49a7ca1163a2cbc0bb65d

Strangerke Strangerke at scummvm.org
Wed Oct 30 23:15:15 CET 2013


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

Summary:
5b086651ba TOON: For consistency, replace the remaining strncpy by strlcpy
7843acc907 MORTEVIELLE: Replace strncpy by strlcpy


Commit: 5b086651ba61b8e51c702840bec12cddefb1188e
    https://github.com/scummvm/scummvm/commit/5b086651ba61b8e51c702840bec12cddefb1188e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-30T15:14:13-07:00

Commit Message:
TOON: For consistency, replace the remaining strncpy by strlcpy

Changed paths:
    engines/toon/font.cpp
    engines/toon/script.cpp



diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp
index c016120..2ba4eff 100644
--- a/engines/toon/font.cpp
+++ b/engines/toon/font.cpp
@@ -197,8 +197,7 @@ void FontRenderer::renderMultiLineText(int16 x, int16 y, const Common::String &o
 	// divide the text in several lines
 	// based on number of characters or size of lines.
 	byte text[1024];
-	strncpy((char *)text, origText.c_str(), 1023);
-	text[1023] = 0;
+	Common::strlcpy((char *)text, origText.c_str(), 1024);
 
 	byte *lines[16];
 	int32 lineSize[16];
diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp
index 3e6738f..d752c27 100644
--- a/engines/toon/script.cpp
+++ b/engines/toon/script.cpp
@@ -134,8 +134,7 @@ bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Commo
 
 	_scriptData->sysFuncs = opcodes;
 
-	strncpy(_scriptData->filename, filename, 13);
-	_scriptData->filename[12] = 0;
+	Common::strlcpy(_scriptData->filename, filename, 13);
 
 	_scriptData = 0;
 	_filename = 0;


Commit: 7843acc90783b1d052b49a7ca1163a2cbc0bb65d
    https://github.com/scummvm/scummvm/commit/7843acc90783b1d052b49a7ca1163a2cbc0bb65d
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-10-30T15:14:15-07:00

Commit Message:
MORTEVIELLE: Replace strncpy by strlcpy

Changed paths:
    engines/mortevielle/utils.cpp



diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 7809143..0b13df2 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2364,8 +2364,7 @@ Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t
 
 	// Copy the substring into a temporary buffer
 	char *tmp = new char[size + 1];
-	strncpy(tmp, s.c_str() + idx - 1, size);
-	tmp[size] = '\0';
+	Common::strlcpy(tmp, s.c_str() + idx - 1, size + 1);
 
 	Common::String result(tmp);
 	delete[] tmp;






More information about the Scummvm-git-logs mailing list