diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c index 0096735bd..eb6414d9c 100644 --- a/programs/x509/cert_app.c +++ b/programs/x509/cert_app.c @@ -190,19 +190,17 @@ int main( int argc, char *argv[] ) for( i = 1; i < argc; i++ ) { - n = strlen( argv[i] ); - - for( j = 0; j < n; j++ ) - { - if( argv[i][j] >= 'A' && argv[i][j] <= 'Z' ) - argv[i][j] |= 0x20; - } - p = argv[i]; if( ( q = strchr( p, '=' ) ) == NULL ) goto usage; *q++ = '\0'; + for( j = 0; p + j < q; j++ ) + { + if( argv[i][j] >= 'A' && argv[i][j] <= 'Z' ) + argv[i][j] |= 0x20; + } + if( strcmp( p, "mode" ) == 0 ) { if( strcmp( q, "file" ) == 0 )