diff options
-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"); |