diff options
author | rubidium <rubidium@openttd.org> | 2009-10-13 20:19:34 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-13 20:19:34 +0000 |
commit | 3bb1f4217dcb229c2e064e9f0e1d58a757474cc0 (patch) | |
tree | e06f35be311d13016ca78baa6bf5972cf9dff6de /src/network | |
parent | 313fb659433b0af187e04185d0b7875889548372 (diff) | |
download | openttd-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')
-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(); |