From: Jacob Adams Date: Wed, 18 Mar 2015 00:30:29 +0000 (-0400) Subject: Check argc is greater than 1 before using on argv X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/processing.js?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F2959%2F1;p=minix.git Check argc is greater than 1 before using on argv closes #19 Change-Id: I50ee3fa82bce274e710434628b6c178467fd3887 --- diff --git a/minix/commands/recwave/recwave.c b/minix/commands/recwave/recwave.c index 681b5c052..09fa87ba6 100644 --- a/minix/commands/recwave/recwave.c +++ b/minix/commands/recwave/recwave.c @@ -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);