diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 8e9b4cc66..ef05ad931 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -86,7 +86,7 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint8 duration, const char * Utf8TrimString(buf, DRAW_STRING_BUFFER); /* Force linebreaks for strings that are too long */ - lines = GB(FormatStringLinebreaks(buf, _chatmsg_box.width - 8), 0, 16) + 1; + lines = GB(FormatStringLinebreaks(buf, lastof(buf), _chatmsg_box.width - 8), 0, 16) + 1; if (lines >= MAX_CHAT_MESSAGES) return; msg_count = GetChatMessageCount(); |