mosh-server: Catch exception for parsing nonintegral number of colors
Print a real error message instead of abnormally aborting. Found by Coverity Scan service. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
John Hood
parent
23f0eedb8c
commit
c03bacd0c9
@@ -200,7 +200,13 @@ int main( int argc, char *argv[] )
|
|||||||
fatal_assert( desired_ip );
|
fatal_assert( desired_ip );
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
colors = myatoi( optarg );
|
try {
|
||||||
|
colors = myatoi( optarg );
|
||||||
|
} catch ( const CryptoException & ) {
|
||||||
|
fprintf( stderr, "%s: Bad number of colors (%s)\n", argv[ 0 ], optarg );
|
||||||
|
print_usage( argv[ 0 ] );
|
||||||
|
exit( 1 );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user