Check argc is greater than 1 before using on argv
closes #19 Change-Id: I50ee3fa82bce274e710434628b6c178467fd3887
This commit is contained in:
parent
41b870c890
commit
25223c2ae2
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue