Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2016 17:48:04 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299687 - head/usr.sbin/binmiscctl
Message-ID:  <201605131748.u4DHm41D036373@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: truckman
Date: Fri May 13 17:48:04 2016
New Revision: 299687
URL: https://svnweb.freebsd.org/changeset/base/299687

Log:
  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

Modified:
  head/usr.sbin/binmiscctl/binmiscctl.c

Modified: head/usr.sbin/binmiscctl/binmiscctl.c
==============================================================================
--- head/usr.sbin/binmiscctl/binmiscctl.c	Fri May 13 17:44:20 2016	(r299686)
+++ head/usr.sbin/binmiscctl/binmiscctl.c	Fri May 13 17:48:04 2016	(r299687)
@@ -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++;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605131748.u4DHm41D036373>