nano

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

commit b4a5fac744cac7f8da2f97d26a23a31d0502dcce
parent f816da413ab65cd78bbc4602cbfa7ce92716b433
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 14 Oct 2019 19:19:53 +0200

tweaks: use a literal NULL instead of a variable that is NULL

Now all calls of mallocstrncpy() have NULL as the first parameter
(apart from one call in utils.c, but that can be changed), so the
function can be simplified.

Diffstat:
Msrc/text.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text.c b/src/text.c @@ -1984,7 +1984,7 @@ void do_justify(bool full_justify) /* Copy the leading part that is to be used for the new paragraph. */ quote_len = quote_length(first_par_line->data); lead_len = quote_len + indent_length(first_par_line->data + quote_len); - the_lead = mallocstrncpy(the_lead, first_par_line->data, lead_len + 1); + the_lead = mallocstrncpy(NULL, first_par_line->data, lead_len + 1); the_lead[lead_len] = '\0'; /* Copy the leading part that is to be used for the new paragraph after