agetty: fix invalid usage crash

$ agetty
agetty: not enough arguments: Success
Segmentation fault (core dumped)

Reference: 9325dbfd20
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-07-30 14:59:24 +01:00
parent 63d94613a8
commit 82214f45e9
No known key found for this signature in database
GPG Key ID: A9553245FDE9B739
1 changed files with 2 additions and 2 deletions

View File

@ -847,7 +847,7 @@ static void parse_args(int argc, char **argv, struct options *op)
if (argc < optind + 1) {
log_warn(_("not enough arguments"));
warn(_("not enough arguments"));
errx(EXIT_FAILURE, _("not enough arguments"));
}
/* Accept "tty", "baudrate tty", and "tty baudrate". */
@ -856,7 +856,7 @@ static void parse_args(int argc, char **argv, struct options *op)
parse_speeds(op, argv[optind++]);
if (argc < optind + 1) {
log_warn(_("not enough arguments"));
warn(_("not enough arguments"));
errx(EXIT_FAILURE, _("not enough arguments"));
}
op->tty = argv[optind++];
} else {