Commit 5a240000862756978a06dd7bccd8905e42f27469

Authored by knodlseder
1 parent 1ac59e97

correct calculation of vector size for non-string columns

Showing 1 changed file with 7 additions and 3 deletions
src/fits/GFitsTable.cpp
... ... @@ -262,9 +262,13 @@ void GFitsTable::open(__fitsfile* fptr)
262 262 // Extract column vector size
263 263 if (m_columns[i]->m_repeat == 1) // ASCII tables
264 264 m_columns[i]->m_number = 1;
265   - else // Binary tables
266   - m_columns[i]->m_number = m_columns[i]->m_repeat /
267   - m_columns[i]->m_width;
  265 + else { // Binary tables
  266 + if (typecode == __TSTRING)
  267 + m_columns[i]->m_number = m_columns[i]->m_repeat /
  268 + m_columns[i]->m_width;
  269 + else
  270 + m_columns[i]->m_number = m_columns[i]->m_repeat;
  271 + }
268 272  
269 273 } // endfor: looped over all columns
270 274  
... ...