nano

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

commit 65661777439e54f9c673895473283377eafbb433
parent 443e1484e5c0d62fe6f3b81653d267ec94a4e631
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon,  1 May 2017 17:42:55 +0200

tweaks: add a warning for a condition that should never occur

Diffstat:
Msrc/help.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/help.c b/src/help.c @@ -475,7 +475,7 @@ void help_init(void) } #endif - /* Allocate space for the help text. */ + /* Allocate memory for the help text. */ help_text = charalloc(allocsize + 1); /* Now add the text we want. */ @@ -557,8 +557,8 @@ void help_init(void) } #endif /* !NANO_TINY */ - /* If all went well, we didn't overwrite the allocated space. */ - assert(strlen(help_text) <= allocsize + 1); + if (strlen(help_text) > allocsize) + statusline(ALERT, "Help text spilled over -- please report a bug"); } /* Return the function that is bound to the given key, accepting certain