From 1f45a6bd4f71f7cd2e68897fe1e0a9c74c12db5a Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Thu, 3 Mar 2016 04:13:56 +0100 Subject: [PATCH] Always add a new line after a console message --- natives.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/natives.cpp b/natives.cpp index 06c96eb..997f329 100644 --- a/natives.cpp +++ b/natives.cpp @@ -271,15 +271,12 @@ static cell_t Native_BroadcastConsoleMessage(IPluginContext *pContext, const cel size_t len; { DetectExceptions eh(pContext); - len = smutils->FormatString(buffer, sizeof(buffer) - 2, pContext, params, 1); + len = smutils->FormatString(buffer, sizeof(buffer), pContext, params, 1); if (eh.HasException()) return 0; } - buffer[len++] = '\n'; - buffer[len] = '\0'; - - static char fmt[] = "%s"; + static char fmt[] = "%s\n"; if (pBroadcastPrintf) { @@ -578,7 +575,7 @@ static cell_t Native_PrintToDemoConsole(IPluginContext *pContext, const cell_t * return 0; } - pClient->ClientPrintf("%s", buffer); + pClient->ClientPrintf("%s\n", buffer); return 1; }