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

tweaks: drop an assert, add a warning, and change a 'for' to a 'while'

No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
......@@ -179,15 +179,17 @@ void renumber(filestruct *line)
{
ssize_t number;
if (line == NULL)
if (line == NULL) {
statusline(ALERT, "Trying to renumber nothing -- please report a bug");
return;
}
number = (line->prev == NULL) ? 0 : line->prev->lineno;
assert(line != line->next);
for (; line != NULL; line = line->next)
while (line != NULL) {
line->lineno = ++number;
line = line->next;
}
}
/* Partition the current buffer so that it appears to begin at (top, top_x)
......
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