[Scummvm-cvs-logs] SF.net SVN: scummvm:[53602] scummvm/trunk/engines/sword25/kernel/log.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Tue Oct 19 10:12:04 CEST 2010
Revision: 53602
http://scummvm.svn.sourceforge.net/scummvm/?rev=53602&view=rev
Author: dreammaster
Date: 2010-10-19 08:12:04 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
SWORD25: Fix cppcheck warnings in BS_Log::LogPrefix
The LogPrefix method isn't currently used, but I'm fixing it just in case it's ever used again
Modified Paths:
--------------
scummvm/trunk/engines/sword25/kernel/log.cpp
Modified: scummvm/trunk/engines/sword25/kernel/log.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/log.cpp 2010-10-19 07:37:50 UTC (rev 53601)
+++ scummvm/trunk/engines/sword25/kernel/log.cpp 2010-10-19 08:12:04 UTC (rev 53602)
@@ -100,19 +100,20 @@
// If the issue has ceased at the beginning of a new line, the new issue to begin with the prefix
ExtFormat[0] = 0;
if (_LineBegin) {
- snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
+ snprintf(ExtFormat, sizeof(ExtFormat), "%s: ", Prefix);
_LineBegin = false;
}
// Format String pass line by line and each line with the initial prefix
for (;;) {
const char *NextLine = strstr(Format, "\n");
if (!NextLine || *(NextLine + strlen("\n")) == 0) {
- snprintf(ExtFormat, sizeof(ExtFormat), "%s%s", ExtFormat, Format);
+ Common::strlcat(ExtFormat, Format, sizeof(ExtFormat));
if (NextLine) _LineBegin = true;
break;
} else {
strncat(ExtFormat, Format, (NextLine - Format) + strlen("\n"));
- snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
+ Common::strlcat(ExtFormat, Prefix, sizeof(ExtFormat));
+ Common::strlcat(ExtFormat, ": ", sizeof(ExtFormat));
}
Format = NextLine + strlen("\n");
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