From 8cd53e16b5229196eda23a5c90404654b07de0c7 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 5 Feb 2012 20:54:58 +0100 Subject: [PATCH] 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 --- skill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skill.c b/skill.c index e7ec5ec8..68025424 100644 --- a/skill.c +++ b/skill.c @@ -546,7 +546,7 @@ static void skillsnice_parse(int argc, ENLIST(tty, sbuf.st_rdev); if (!NEXTARG) break; - } else if (!(optarg[1])) { + } else if (optarg && !(optarg[1])) { /* if only 1 character */ switch (*optarg) { default: -- 2.40.0