Invoking trick-ICG without any arguments results in a Segmentation fault

ICG dies on a strdup if the the input file is empty.  Added a check for
an empty input file name.  We exit with an error message if there is
no input file given.

refs #229
This commit is contained in:
Alex Lin 2016-04-27 11:24:03 -05:00
parent c4a5e8b310
commit 3f7676a740

View File

@ -85,6 +85,11 @@ int main( int argc , char * argv[] ) {
return 0 ;
}
if ( input_file_names.empty() ) {
std::cerr << "No header file specified" << std::endl ;
return 1 ;
}
#if (__clang_major__ == 3) && (__clang_minor__ >= 3)
ci.createDiagnostics();
#else