[Scummvm-cvs-logs] SF.net SVN: scummvm:[39197] scummvm/branches/branch-0-13-0/engines
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Sat Mar 7 18:56:56 CET 2009
Revision: 39197
http://scummvm.svn.sourceforge.net/scummvm/?rev=39197&view=rev
Author: wjpalenstijn
Date: 2009-03-07 17:56:56 +0000 (Sat, 07 Mar 2009)
Log Message:
-----------
Patch #2671477: Fix wrong usage of strncat
Modified Paths:
--------------
scummvm/branches/branch-0-13-0/engines/saga/sfuncs.cpp
scummvm/branches/branch-0-13-0/engines/scumm/he/logic_he.cpp
Modified: scummvm/branches/branch-0-13-0/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/saga/sfuncs.cpp 2009-03-07 17:55:00 UTC (rev 39196)
+++ scummvm/branches/branch-0-13-0/engines/saga/sfuncs.cpp 2009-03-07 17:56:56 UTC (rev 39197)
@@ -1570,9 +1570,9 @@
for (int i = 0; i < nArgs; i++) {
snprintf(buf1, 100, "%d", thread->pop());
- strncat(buf, buf1, 256);
+ strncat(buf, buf1, sizeof(buf) - strlen(buf) - 1);
if (i + 1 < nArgs)
- strncat(buf, ", ", 256);
+ strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
}
debug(0, "%s)", buf);
Modified: scummvm/branches/branch-0-13-0/engines/scumm/he/logic_he.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/scumm/he/logic_he.cpp 2009-03-07 17:55:00 UTC (rev 39196)
+++ scummvm/branches/branch-0-13-0/engines/scumm/he/logic_he.cpp 2009-03-07 17:56:56 UTC (rev 39197)
@@ -86,9 +86,9 @@
for (int i = 1; i < numArgs; i++) {
snprintf(tmp, 32, ", %d", args[i]);
- strncat(str, tmp, 256);
+ strncat(str, tmp, sizeof(str) - strlen(str) - 1);
}
- strncat(str, "])", 256);
+ strncat(str, "])", sizeof(str) - strlen(str) - 1);
debug(0, "%s", str);
#else
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