summaryrefslogtreecommitdiff
path: root/src/network/network_chat_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-13 20:19:34 +0000
committerrubidium <rubidium@openttd.org>2009-10-13 20:19:34 +0000
commit3bb1f4217dcb229c2e064e9f0e1d58a757474cc0 (patch)
treee06f35be311d13016ca78baa6bf5972cf9dff6de /src/network/network_chat_gui.cpp
parent313fb659433b0af187e04185d0b7875889548372 (diff)
downloadopenttd-3bb1f4217dcb229c2e064e9f0e1d58a757474cc0.tar.xz
(svn r17772) -Fix [FS#3264]: CJK languages don't have spaces, so for adding newlines (multi line strings) we need to (properly) handle the case when there are no spaces instead of truncating the string.
Diffstat (limited to 'src/network/network_chat_gui.cpp')
-rw-r--r--src/network/network_chat_gui.cpp2
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();