diff options
-rw-r--r-- | test/test.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/test.c b/test/test.c index d2d791efd..eb1c0ced4 100644 --- a/test/test.c +++ b/test/test.c @@ -2661,14 +2661,17 @@ static int ParseOptions( int argc, char ** argv ) break; case 'n': { - int i; - char * tmp = optarg; - for( i = 0; i < 4; i++ ) + if( optarg != NULL ) { - if( !*tmp ) - break; - crop[i] = strtol( tmp, &tmp, 0 ); - tmp++; + int i; + char * tmp = optarg; + for( i = 0; i < 4; i++ ) + { + if( !*tmp ) + break; + crop[i] = strtol( tmp, &tmp, 0 ); + tmp++; + } } break; } |