Skip to content

Commit ecdff1a

Browse files
Ko van der SlootKo van der Sloot
authored andcommitted
added error message when the index file is empty.
1 parent 91c1593 commit ecdff1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/TICCL-LDcalc.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,11 @@ int main( int argc, char **argv ){
11091109
while ( getline( indexf, line ) ){
11101110
++file_lines;
11111111
}
1112+
if ( file_lines == 0 ){
1113+
cerr << "the indexfile: '" << indexFile
1114+
<< "' is empty! No further processing possible." << endl;
1115+
exit( EXIT_FAILURE );
1116+
}
11121117
cout << progname << ": " << file_lines << " character confusion values to be read.\n\t\tWe indicate progress by printing a dot for every 1000 confusion values processed" << endl;
11131118
indexf.clear();
11141119
indexf.seekg( 0 );
@@ -1129,7 +1134,7 @@ int main( int argc, char **argv ){
11291134
vector<string> parts;
11301135
if ( TiCC::split_at( line, parts, "#" ) != 2 ){
11311136
cerr << progname << ": ERROR in line " << line_nr
1132-
<< " of indexfile: unable to split in 2 parts at #"
1137+
<< " of the indexfile: unable to split in 2 parts at #"
11331138
<< endl << "line was" << endl << line << endl;
11341139
++err_cnt;
11351140
}

0 commit comments

Comments
 (0)