Changeset 32409 for trunk/psLib/src/fits/psFitsTableNew.c
- Timestamp:
- Sep 16, 2011, 5:09:33 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFitsTableNew.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFitsTableNew.c
r32361 r32409 117 117 118 118 psFitsTable* psFitsTableAlloc(int numCols, int numRows) { 119 if (numCols <= 0) { 119 if (numCols < 0) { 120 // empty table 120 121 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 121 122 "Can't allocate a psFitsTable with %d columns.", numCols); … … 127 128 table->numRows = numRows; 128 129 table->numCols = numCols; 129 table->columns = psAlloc(sizeof(psFitsTableColumn) * numCols); 130 memset(table->columns, sizeof(psFitsTableColumn) * numCols, 0); 130 if (numCols > 0) { 131 table->columns = psAlloc(sizeof(psFitsTableColumn) * numCols); 132 memset(table->columns, sizeof(psFitsTableColumn) * numCols, 0); 133 } else { 134 table->columns = NULL; 135 } 131 136 psMemSetDeallocator(table, (psFreeFunc) freeTable); 132 137 … … 141 146 if (!readTableCheck(fits)) { 142 147 if (emptyTableCheck(fits)) { 143 return NULL; 148 psFitsTable *table = psFitsTableAlloc(0, 0); 149 return table; 144 150 } 145 151 psError(PS_ERR_BAD_FITS, true, "Extension is not a table");
Note:
See TracChangeset
for help on using the changeset viewer.
