From a0059a24e36ab2b8a6b4c1180a1ac599cd95f280 Mon Sep 17 00:00:00 2001 From: truckman Date: Fri, 13 May 2016 17:48:04 +0000 Subject: [PATCH] Another attempt at resolving CID 1305629. The test of cmd == -1 may make Coverity think that other negative values of cmd (used as an index) are possible. Testing < 0 is a more common idiom in any case. Reported by: Coverity CID: 1305629 --- usr.sbin/binmiscctl/binmiscctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/binmiscctl/binmiscctl.c b/usr.sbin/binmiscctl/binmiscctl.c index 5ab82e4cd42a..2483a8173dfc 100644 --- a/usr.sbin/binmiscctl/binmiscctl.c +++ b/usr.sbin/binmiscctl/binmiscctl.c @@ -416,7 +416,7 @@ main(int argc, char **argv) argc--, argv++; cmd = demux_cmd(argc, argv); - if (cmd == -1) + if (cmd < 0) usage("Error: Unknown command \"%s\"", argv[0]); argc--, argv++;