Commit ac554b89 authored by Karl Wette's avatar Karl Wette
Browse files

FITSFileIO: error if no items found to read into string vector

Original: a0e0e21137c115c7d6a5e43dbaeb6542c6dfe40e
parent 6b569822
......@@ -797,6 +797,7 @@ int XLALFITSHeaderReadStringVector( FITSFile *file, const CHAR *key, LALStringVe
}
int nfound = 0;
CALL_FITS( fits_read_keys_str, file->ff, keyword, 1, FFIO_MAX, vals_ptr, &nfound );
XLAL_CHECK_FAIL( 0 < nfound, XLAL_EIO, "No items to read into string vector '%s'", keyword );
XLAL_CHECK_FAIL( nfound <= FFIO_MAX, XLAL_EIO, "Too many items to read into string vector '%s'", keyword );
for ( int i = 0; i < nfound; ++i ) {
*values = XLALAppendString2Vector( *values, vals[i] );
......@@ -810,7 +811,6 @@ XLAL_FAIL:
}
int XLALFITSHeaderWriteGPSTime( FITSFile *file, const CHAR *key, const LIGOTimeGPS *value, const CHAR *comment )
{
int UNUSED status = 0;
......
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