Commit d278868a authored by Bernd Machenschalk's avatar Bernd Machenschalk
Browse files

write out the return value of sscanf in case scanning fails

Original: 49dc9291b3aa32bdc0f93bf3041e0fc1766995db
parent 2432a3ac
......@@ -2497,8 +2497,10 @@ XLALReadSegmentsFromFile ( const char *fname /**< name of file containing segmen
REAL8 t0, t1, TspanHours;
INT4 NSFT;
LALSeg thisSeg;
if ( sscanf ( flines->lines->tokens[iSeg], "%lf %lf %lf %d\n", &t0, &t1, &TspanHours, &NSFT ) != 4 ) {
XLALPrintError ("%s: failed to parse data-line %d in segment-list %s: '%s'\n", fn, iSeg, fname, flines->lines->tokens[iSeg] );
int ret;
ret = sscanf ( flines->lines->tokens[iSeg], "%lf %lf %lf %d", &t0, &t1, &TspanHours, &NSFT );
if ( ret != 4 ) {
XLALPrintError ("%s: failed to parse data-line %d (%d) in segment-list %s: '%s'\n", fn, iSeg, ret, fname, flines->lines->tokens[iSeg] );
XLALSegListClear ( segList );
XLALFree ( segList );
XLALDestroyParsedDataFile ( &flines );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment