summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-09-17 00:55:31 -0300
committerdequis <dx@dxzone.com.ar>2015-09-21 17:53:46 -0300
commitf39723f6510bf57c5d21d62d55be6eefb6305078 (patch)
tree67e5ca53c4a39424fde27d1335213cca036b7733 /src/fe-text
parent211e84c1e968b0b13ecb0921479bc862ed76df3c (diff)
downloadirssi-f39723f6510bf57c5d21d62d55be6eefb6305078.zip
Fix FS#905, mangled text when pasted line length exceeds 400
http://bugs.irssi.org/index.php?do=details&task_id=905 Not using the patch from that ticket, the issue turned out to be that (dest - last_lf_pos) returned number of unichr, not bytes, so that's 4 times less than what the size parameter of memmove() should be.
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/gui-readline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
index edc4c55d..ec61e317 100644
--- a/src/fe-text/gui-readline.c
+++ b/src/fe-text/gui-readline.c
@@ -237,7 +237,7 @@ static void paste_buffer_join_lines(GArray *buf)
last_lf = FALSE;
if (++line_len >= 400 && last_lf_pos != NULL) {
memmove(last_lf_pos+1, last_lf_pos,
- dest - last_lf_pos);
+ (dest - last_lf_pos) * sizeof(unichar));
*last_lf_pos = '\n'; last_lf_pos = NULL;
line_len = 0;
dest++;