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++;
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to