nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 85bffcfeb9dcd187f766d55412cdc13bf68d3ab0
parent 381a386b015ced15e3e91e8a80f05de8129d06e7
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Mon, 24 Jul 2017 14:23:19 -0500

tweaks: use charalloc() instead of (char *)nmalloc() * sizeof(char)

The charalloc() macro does exactly this.

Diffstat:
Msrc/text.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -3604,7 +3604,7 @@ char *copy_completion(char *check_line, int start) position = next; } - word = (char *)nmalloc((len_of_word + 1) * sizeof(char)); + word = charalloc(len_of_word + 1); /* Simply copy the word. */ while (index < len_of_word) @@ -3669,7 +3669,7 @@ void complete_a_word(void) return; } - shard = (char *)nmalloc((openfile->current_x - start_of_shard + 1) * sizeof(char)); + shard = charalloc(openfile->current_x - start_of_shard + 1); /* Copy the fragment that has to be searched for. */ while (start_of_shard < openfile->current_x)