mirror of git://git.sv.gnu.org/nano.git
As the charmove() already copies the terminating null byte,
there is no need to put one in. Just trim the allocation. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
0dec394303
commit
27e1e83e8c
|
@ -12,6 +12,8 @@
|
||||||
* src/prompt.c (do_statusbar_output): Don't move too many bytes.
|
* src/prompt.c (do_statusbar_output): Don't move too many bytes.
|
||||||
This fixes Savannah bug #47219 (uncovered by r5655).
|
This fixes Savannah bug #47219 (uncovered by r5655).
|
||||||
* src/prompt.c (do_statusbar_output): Elide a variable.
|
* src/prompt.c (do_statusbar_output): Elide a variable.
|
||||||
|
* src/prompt.c (do_statusbar_delete): There is no need for nulling:
|
||||||
|
the charmove() already copies the terminating null byte.
|
||||||
|
|
||||||
2016-02-21 Benno Schulenberg <bensberg@justemail.net>
|
2016-02-21 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/files.c (input_tab): If the first Tab added the part that all
|
* src/files.c (input_tab): If the first Tab added the part that all
|
||||||
|
|
|
@ -349,14 +349,12 @@ void do_statusbar_delete(void)
|
||||||
|
|
||||||
if (answer[statusbar_x] != '\0') {
|
if (answer[statusbar_x] != '\0') {
|
||||||
int char_buf_len = parse_mbchar(answer + statusbar_x, NULL, NULL);
|
int char_buf_len = parse_mbchar(answer + statusbar_x, NULL, NULL);
|
||||||
size_t line_len = strlen(answer + statusbar_x);
|
|
||||||
|
|
||||||
assert(statusbar_x < strlen(answer));
|
assert(statusbar_x < strlen(answer));
|
||||||
|
|
||||||
charmove(answer + statusbar_x, answer + statusbar_x + char_buf_len,
|
charmove(answer + statusbar_x, answer + statusbar_x + char_buf_len,
|
||||||
strlen(answer) - statusbar_x - char_buf_len + 1);
|
strlen(answer) - statusbar_x - char_buf_len + 1);
|
||||||
|
align(&answer);
|
||||||
null_at(&answer, statusbar_x + line_len - char_buf_len);
|
|
||||||
|
|
||||||
update_the_statusbar();
|
update_the_statusbar();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue