diff options
author | Paul Gilbert | 2010-10-19 08:12:04 +0000 |
---|---|---|
committer | Paul Gilbert | 2010-10-19 08:12:04 +0000 |
commit | 355032d4f9600eea3684cab3166375053fbd9d8b (patch) | |
tree | e71f398572d5dda0fcca6b28d089c0930ed3f705 | |
parent | 00bf6ab791f89db92052c62186465daf33f15e05 (diff) | |
download | scummvm-rg350-355032d4f9600eea3684cab3166375053fbd9d8b.tar.gz scummvm-rg350-355032d4f9600eea3684cab3166375053fbd9d8b.tar.bz2 scummvm-rg350-355032d4f9600eea3684cab3166375053fbd9d8b.zip |
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
svn-id: r53602
-rw-r--r-- | engines/sword25/kernel/log.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/sword25/kernel/log.cpp b/engines/sword25/kernel/log.cpp index dd8b073422..95691e6b48 100644 --- a/engines/sword25/kernel/log.cpp +++ b/engines/sword25/kernel/log.cpp @@ -100,19 +100,20 @@ void BS_Log::LogPrefix(const char *Prefix, const char *Format, ...) { // 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"); |