diff options
author | Damiano Galassi <[email protected]> | 2017-05-31 11:34:32 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-05-31 11:34:32 +0200 |
commit | a3d93aa2e1c285e03d6b8ceecad7d288e9369b1f (patch) | |
tree | 6a612c504a0ba71728aff645b68c1787d49605dd | |
parent | 7c438ad5ae81c31c660fc9a208dacd7177f54a24 (diff) |
cli: add an additional null check to silence a clang static analyizer warning.
-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; } |