Check argc is greater than 1 before using on argv

closes #19

Change-Id: I50ee3fa82bce274e710434628b6c178467fd3887
This commit is contained in:
Jacob Adams 2015-03-17 20:30:29 -04:00 committed by Lionel Sambuc
parent 41b870c890
commit 25223c2ae2

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