skill: ensure optarg is not null [smatch scan]
skill.c:549 skillsnice_parse(87) error: we previously assumed 'optarg' could be null (see line 539) Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
ffe5e0b08e
commit
8cd53e16b5
2
skill.c
2
skill.c
@ -546,7 +546,7 @@ static void skillsnice_parse(int argc,
|
|||||||
ENLIST(tty, sbuf.st_rdev);
|
ENLIST(tty, sbuf.st_rdev);
|
||||||
if (!NEXTARG)
|
if (!NEXTARG)
|
||||||
break;
|
break;
|
||||||
} else if (!(optarg[1])) {
|
} else if (optarg && !(optarg[1])) {
|
||||||
/* if only 1 character */
|
/* if only 1 character */
|
||||||
switch (*optarg) {
|
switch (*optarg) {
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user