feedback: replace an assert with a check plus error message at startup

master
Benno Schulenberg 2019-04-06 10:03:52 +02:00
parent f585403b36
commit 408f15954e
2 changed files with 3 additions and 2 deletions

View File

@ -1130,6 +1130,9 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
if (has_blank_char(option)) {
rcfile_error(N_("Non-blank characters required"));
free(option);
} else if (mbstrlen(option) % 2 != 0) {
rcfile_error(N_("Even number of characters required"));
free(option);
} else
matchbrackets = option;
} else if (strcasecmp(rcopts[i].name, "whitespace") == 0) {

View File

@ -943,8 +943,6 @@ void do_find_bracket(void)
bool reverse;
/* The direction we search. */
assert(mbstrlen(matchbrackets) % 2 == 0);
ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x);
if (ch == NULL) {