From dfa6a44402bcd8a4ae47c9e1fa68c3ed68b6a3ef Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Tue, 23 Dec 2014 22:38:12 +1300 Subject: [PATCH 1/2] Ignore 0 length chat messages - There is no reason to send empty messages, and they just produced strange output anyway --- src/ct_chat.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index c0b73d3c0..10ff2bffb 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -343,6 +343,9 @@ static void CT_ClearChatMessage () static void ShoveChatStr (const char *str, BYTE who) { + if (strlen(str) < 1) // Don't send empty messages + return; + FString substBuff; if (str[0] == '/' && From 5caadeba4c349c6c7de82d667eb161007869f558 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 23 Dec 2014 21:33:47 -0600 Subject: [PATCH 2/2] Use a null check instead of strlen in ShoveChatStr --- src/ct_chat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index 10ff2bffb..78efab9d0 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -343,7 +343,8 @@ static void CT_ClearChatMessage () static void ShoveChatStr (const char *str, BYTE who) { - if (strlen(str) < 1) // Don't send empty messages + // Don't send empty messages + if (str == NULL || str[0] == '\0') return; FString substBuff;