Changeset 41433 for trunk/Ohana/src/libfits/table/F_get_column.c
- Timestamp:
- Nov 10, 2020, 1:26:09 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_get_column.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_get_column.c
r41422 r41433 318 318 319 319 /***********************/ 320 int gfits_get_table_column_type (Header *header, char *label, char *type ) {321 322 int i, N, Nfields, N val, Nbytes;320 int gfits_get_table_column_type (Header *header, char *label, char *type, int *Nval) { 321 322 int i, N, Nfields, Nbytes; 323 323 char tlabel[256], field[256], format[256]; 324 324 … … 340 340 gfits_scan (header, field, "%s", 1, format); 341 341 342 if (!gfits_table_format (format, type, &Nval, &Nbytes)) return (FALSE); 342 if (!gfits_table_format (format, type, Nval, &Nbytes)) return (FALSE); 343 *Nval = 1; 344 343 345 return (TRUE); 344 346 } … … 404 406 for (i = 0; i < Ny; i++, Pin+=Nx, Pout+=4) { 405 407 memcpy (line, Pin, Nval*Nbytes); 406 sscanf (line, "%d", (int *)Pout);408 sscanf (line, cformat, (int *)Pout); 407 409 } 408 410 } … … 420 422 for (i = 0; i < Ny; i++, Pin+=Nx, Pout+=4) { 421 423 memcpy (line, Pin, Nval*Nbytes); 422 sscanf (line, "%f", (float *)Pout);424 sscanf (line, cformat, (float *)Pout); 423 425 } 424 426 }
Note:
See TracChangeset
for help on using the changeset viewer.
