Commit 65661777 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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

No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
...@@ -475,7 +475,7 @@ void help_init(void) ...@@ -475,7 +475,7 @@ void help_init(void)
} }
#endif #endif
/* Allocate space for the help text. */ /* Allocate memory for the help text. */
help_text = charalloc(allocsize + 1); help_text = charalloc(allocsize + 1);
/* Now add the text we want. */ /* Now add the text we want. */
...@@ -557,8 +557,8 @@ void help_init(void) ...@@ -557,8 +557,8 @@ void help_init(void)
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
/* If all went well, we didn't overwrite the allocated space. */ if (strlen(help_text) > allocsize)
assert(strlen(help_text) <= allocsize + 1); statusline(ALERT, "Help text spilled over -- please report a bug");
} }
/* Return the function that is bound to the given key, accepting certain /* Return the function that is bound to the given key, accepting certain
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment