]> Zhao Yanbai Git Server - minix.git/commitdiff
Check argc is greater than 1 before using on argv 59/2959/1
authorJacob Adams <tookmund@gmail.com>
Wed, 18 Mar 2015 00:30:29 +0000 (20:30 -0400)
committerLionel Sambuc <lionel@minix3.org>
Wed, 18 Mar 2015 07:20:08 +0000 (08:20 +0100)
closes #19

Change-Id: I50ee3fa82bce274e710434628b6c178467fd3887

minix/commands/recwave/recwave.c

index 681b5c052560e201da5959e135505fcfed46e699..09fa87ba63bc6957740e8dad75a3057f1e1c1f20 100644 (file)
@@ -136,7 +136,7 @@ char **argv;
   if (argc < 2) usage();
 
   i = 1;
-  while (argv[i][0] == '-' && i < argc)
+  while ((i < argc) && (argv[i][0] == '-'))
   {
     if (strncmp(argv[i], "-b", 2) == 0)
       bits = atoi(argv[i] + 2);