From 011eda7d9e755d1df82b678c05c0cb9b1aaa1e29 Mon Sep 17 00:00:00 2001 From: Fabian Kurz Date: Sun, 22 Nov 2015 21:24:05 +0100 Subject: [PATCH] Correct a wrong use of the 'paste_buffer' variable The function "static void paste_buffer_join_lines(GArray *buf)" in "src/fe-text/gui-readline.c" is supposed to join lines from the GArray pointed to by *buf under certain circumstances. In the code of the function "buf" is actually used for getting the length of the GArray, but to get a pointer to the data, "paste_buffer->data" is used; paste_buffer is defined in the scope of the whole file. This delivers the desired result, because this function is only called once, with "paste_buffer" as the argument. If paste_buffer_join_lines() will ever be used with a different argument, it will fail. --- src/fe-text/gui-readline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index dc7185e7..ecf116fe 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -177,7 +177,7 @@ static void paste_buffer_join_lines(GArray *buf) if (buf->len == 0) return; - arr = (unichar *) paste_buffer->data; + arr = (unichar *)buf->data; /* first line */ if (IS_WHITE(arr[0]))