add asserts to do_wrap()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2399 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
ba1ab86db5
commit
d96ee5260a
|
@ -1567,9 +1567,9 @@ void wrap_reset(void)
|
||||||
* we wrapped. */
|
* we wrapped. */
|
||||||
bool do_wrap(filestruct *line)
|
bool do_wrap(filestruct *line)
|
||||||
{
|
{
|
||||||
size_t line_len = strlen(line->data);
|
size_t line_len;
|
||||||
/* Length of the line we wrap. */
|
/* Length of the line we wrap. */
|
||||||
ssize_t wrap_loc = -1;
|
ssize_t wrap_loc;
|
||||||
/* Index of line->data where we wrap. */
|
/* Index of line->data where we wrap. */
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
const char *indent_string = NULL;
|
const char *indent_string = NULL;
|
||||||
|
@ -1599,6 +1599,11 @@ bool do_wrap(filestruct *line)
|
||||||
* wrapping. Note that if autoindent is turned on, we don't break
|
* wrapping. Note that if autoindent is turned on, we don't break
|
||||||
* at the end of it! */
|
* at the end of it! */
|
||||||
|
|
||||||
|
assert(line != NULL && line->data != NULL);
|
||||||
|
|
||||||
|
/* Save the length of the line. */
|
||||||
|
line_len = strlen(line->data);
|
||||||
|
|
||||||
/* Find the last blank where we can break the line. */
|
/* Find the last blank where we can break the line. */
|
||||||
wrap_loc = break_line(line->data, fill, FALSE);
|
wrap_loc = break_line(line->data, fill, FALSE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue