Avoid case ranges in switch statement

Signed-off-by: Michael Forney <mforney@mforney.org>
This commit is contained in:
Michael Forney 2019-06-15 13:51:56 -07:00
parent 9d1b43d241
commit 7160db054a

View file

@ -913,8 +913,13 @@ parse_file(struct quirks_context *ctx, const char *path)
section = section_new(path, line);
list_append(&ctx->sections, &section->link);
break;
/* entries must start with A-Z */
case 'A'...'Z':
default:
/* entries must start with A-Z */
if (line[0] < 'A' && line[0] > 'Z') {
qlog_parser(ctx, "%s:%d: Unexpected line %s\n",
path, lineno, line);
goto out;
}
switch (state) {
case STATE_SECTION:
qlog_parser(ctx, "%s:%d: expected [Section], got %s\n",
@ -949,10 +954,6 @@ parse_file(struct quirks_context *ctx, const char *path)
goto out;
}
break;
default:
qlog_parser(ctx, "%s:%d: Unexpected line %s\n",
path, lineno, line);
goto out;
}
}