1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

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.
This commit is contained in:
dequis 2015-09-17 00:55:31 -03:00
parent 211e84c1e9
commit f39723f651

View File

@ -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++;