summaryrefslogtreecommitdiff
path: root/src/textbuf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-04-23 20:44:42 +0000
committerfrosch <frosch@openttd.org>2014-04-23 20:44:42 +0000
commitef4c2ce0317ae583e837722b6a41ea44cd83da71 (patch)
treec0c3d77ac495a6b9257cd7de4dadc6712db1acc8 /src/textbuf.cpp
parent56e8ea6ddef08eb6ad1a28d06dddecb902e1bc04 (diff)
downloadopenttd-ef4c2ce0317ae583e837722b6a41ea44cd83da71.tar.xz
(svn r26485) -Codechange: Replace ttd_strlcpy and ttd_strlcat with strecpy and strecat.
Diffstat (limited to 'src/textbuf.cpp')
-rw-r--r--src/textbuf.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/textbuf.cpp b/src/textbuf.cpp
index 80e4f90d7..c11e3c1bf 100644
--- a/src/textbuf.cpp
+++ b/src/textbuf.cpp
@@ -26,9 +26,11 @@
* Try to retrieve the current clipboard contents.
*
* @note OS-specific function.
+ * @param buffer Clipboard content.
+ * @param last The pointer to the last element of the destination buffer
* @return True if some text could be retrieved.
*/
-bool GetClipboardContents(char *buffer, size_t buff_len);
+bool GetClipboardContents(char *buffer, const char *last);
int _caret_timer;
@@ -226,7 +228,7 @@ bool Textbuf::InsertClipboard()
{
char utf8_buf[512];
- if (!GetClipboardContents(utf8_buf, lengthof(utf8_buf))) return false;
+ if (!GetClipboardContents(utf8_buf, lastof(utf8_buf))) return false;
return this->InsertString(utf8_buf, false);
}
@@ -406,7 +408,7 @@ void Textbuf::Assign(StringID string)
*/
void Textbuf::Assign(const char *text)
{
- ttd_strlcpy(this->buf, text, this->max_bytes);
+ strecpy(this->buf, text, &this->buf[this->max_bytes - 1]);
this->UpdateSize();
}