tweaks: remove several unneeded bad-state checks and their messages

No one ever reported seeing any of them, and each of these checks
has been there for at least a year.
master
Benno Schulenberg 2019-04-14 19:28:15 +02:00
parent 145bb6e01a
commit c039aaad9d
4 changed files with 6 additions and 43 deletions

View File

@ -556,9 +556,6 @@ void help_init(void)
} }
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
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 /* Return the function that is bound to the given key, accepting certain

View File

@ -551,10 +551,6 @@ void do_undo(void)
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
break; break;
case ENTER: case ENTER:
if (f->next == NULL) {
statusline(ALERT, "Missing break line -- please report a bug");
break;
}
undidmsg = _("line break"); undidmsg = _("line break");
from_x = (u->begin == 0) ? 0 : u->mark_begin_x; from_x = (u->begin == 0) ? 0 : u->mark_begin_x;
to_x = (u->begin == 0) ? u->mark_begin_x : u->begin; to_x = (u->begin == 0) ? u->mark_begin_x : u->begin;
@ -672,7 +668,6 @@ void do_undo(void)
break; break;
#endif #endif
default: default:
statusline(ALERT, "Wrong undo type -- please report a bug");
break; break;
} }
@ -752,10 +747,6 @@ void do_redo(void)
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
break; break;
case JOIN: case JOIN:
if (f->next == NULL) {
statusline(ALERT, "Missing join line -- please report a bug");
break;
}
redidmsg = _("line join"); redidmsg = _("line join");
/* When the join was done by a Backspace at the tail of the file, /* When the join was done by a Backspace at the tail of the file,
* and the nonewlines flag isn't set, do not join anything, as * and the nonewlines flag isn't set, do not join anything, as
@ -838,7 +829,6 @@ void do_redo(void)
break; break;
#endif #endif
default: default:
statusline(ALERT, "Wrong redo type -- please report a bug");
break; break;
} }
@ -1264,7 +1254,6 @@ void add_undo(undo_type action)
break; break;
#endif #endif
default: default:
statusline(ALERT, "Wrong undo adding type -- please report a bug");
break; break;
} }
@ -1417,7 +1406,6 @@ void update_undo(undo_type action)
u->begin = openfile->current_x; u->begin = openfile->current_x;
break; break;
default: default:
statusline(ALERT, "Wrong undo update type -- please report a bug");
break; break;
} }
} }

View File

@ -329,10 +329,6 @@ char *mallocstrncpy(char *dest, const char *src, size_t n)
if (src == NULL) if (src == NULL)
src = ""; src = "";
#ifndef NANO_TINY
if (src == dest)
fprintf(stderr, "\r*** Copying a string to itself -- please report a bug ***");
#endif
dest = charealloc(dest, n); dest = charealloc(dest, n);
strncpy(dest, src, n); strncpy(dest, src, n);
@ -512,12 +508,10 @@ linestruct *fsfromline(ssize_t lineno)
while (f->lineno != lineno && f->next != NULL) while (f->lineno != lineno && f->next != NULL)
f = f->next; f = f->next;
if (f->lineno != lineno) { if (f->lineno == lineno)
statusline(ALERT, "Gone undo line -- please report a bug");
return NULL;
}
return f; return f;
else
return NULL;
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */

View File

@ -2793,15 +2793,6 @@ int update_line(linestruct *fileptr, size_t index)
row = fileptr->lineno - openfile->edittop->lineno; row = fileptr->lineno - openfile->edittop->lineno;
/* If the line is offscreen, don't even try to display it. */
if (row < 0 || row >= editwinrows) {
#ifndef NANO_TINY
statusline(ALERT, "Badness: tried to display a line on row %i"
" -- please report a bug", row);
#endif
return 0;
}
/* First, blank out the row. */ /* First, blank out the row. */
blank_row(edit, row, 0, COLS); blank_row(edit, row, 0, COLS);
@ -3017,20 +3008,13 @@ void edit_scroll(bool direction)
{ {
linestruct *line; linestruct *line;
size_t leftedge; size_t leftedge;
int remainder = 0, nrows = 1; int nrows = 1;
/* Move the top line of the edit window one row up or down. */ /* Move the top line of the edit window one row up or down. */
if (direction == BACKWARD) if (direction == BACKWARD)
remainder = go_back_chunks(1, &openfile->edittop, &openfile->firstcolumn); go_back_chunks(1, &openfile->edittop, &openfile->firstcolumn);
else else
remainder = go_forward_chunks(1, &openfile->edittop, &openfile->firstcolumn); go_forward_chunks(1, &openfile->edittop, &openfile->firstcolumn);
if (remainder > 0) {
#ifndef NANO_TINY
statusline(ALERT, "Could not scroll -- please report a bug");
#endif
return;
}
/* Actually scroll the text of the edit window one row up or down. */ /* Actually scroll the text of the edit window one row up or down. */
scrollok(edit, TRUE); scrollok(edit, TRUE);