Check argc is greater than 1 before checking on argv

This commit is contained in:
Jacob Adams 2015-03-17 20:30:29 -04:00
parent 61890c3b2e
commit 1bd0fcb9db

View 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);