summaryrefslogtreecommitdiff
path: root/src/os2.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-10-22 20:23:50 +0000
committersmatz <smatz@openttd.org>2008-10-22 20:23:50 +0000
commit1e7e5fb17567c09f23e4d8418c7783b889898c8a (patch)
treefd4c67715a8eaa696fce171d53c7814b7829b82e /src/os2.cpp
parentf43dc3e758d9183881833f2404272b5652578b31 (diff)
downloadopenttd-1e7e5fb17567c09f23e4d8418c7783b889898c8a.tar.xz
(svn r14518) -Fix (r14514): forgot win32 and OS/2 files (glx)
Diffstat (limited to 'src/os2.cpp')
-rw-r--r--src/os2.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os2.cpp b/src/os2.cpp
index f5ee66cb1..704ffe4a7 100644
--- a/src/os2.cpp
+++ b/src/os2.cpp
@@ -196,7 +196,7 @@ bool InsertTextBufferClipboard(Textbuf *tb)
{
uint w;
- if (tb->length + length >= tb->maxlength - 1) break;
+ if (tb->size + length + 1 > tb->maxsize) break;
w = GetCharacterWidth(FS_NORMAL, (byte)*i);
if (tb->maxwidth != 0 && width + tb->width + w > tb->maxwidth) break;
@@ -205,11 +205,11 @@ bool InsertTextBufferClipboard(Textbuf *tb)
length++;
}
- memmove(tb->buf + tb->caretpos + length, tb->buf + tb->caretpos, tb->length - tb->caretpos + 1);
+ memmove(tb->buf + tb->caretpos + length, tb->buf + tb->caretpos, tb->size - tb->caretpos);
memcpy(tb->buf + tb->caretpos, text, length);
tb->width += width;
tb->caretxoffs += width;
- tb->length += length;
+ tb->size += length;
tb->caretpos += length;
WinCloseClipbrd(hab);