Changeset 3400 for trunk/Ohana/src/libfits/table/F_table_format.c
- Timestamp:
- Mar 9, 2005, 9:20:18 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_table_format.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_table_format.c
r2415 r3400 54 54 int fits_table_format (char *format, char *type, int *Nval, int *Nbytes) { 55 55 56 char Fchar, foo[80], bar;56 char Fchar, Size[80], Type; 57 57 int Nv; 58 58 … … 64 64 if (Nv == 0) { 65 65 Nv = 1; 66 strcpy ( foo, "1");66 strcpy (Size, "1"); 67 67 } else { 68 strcpy ( foo, &format[1]);68 strcpy (Size, &format[1]); 69 69 } 70 71 if (Fchar == 'F') { *Nbytes = 1; strcpy (type, "float"); bar = 'f'; *Nval = Nv; } 72 if (Fchar == 'I') { *Nbytes = 1; strcpy (type, "int"); bar = 'd'; *Nval = Nv; } 73 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); bar = 's'; *Nval = Nv; } 70 71 Type = 'x'; 72 if (Fchar == 'F') { *Nbytes = 1; strcpy (type, "float"); Type = 'f'; *Nval = Nv; } 73 if (Fchar == 'I') { *Nbytes = 1; strcpy (type, "int"); Type = 'd'; *Nval = Nv; } 74 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); Type = 's'; *Nval = Nv; } 74 75 if (!*Nbytes) { return (FALSE); } 75 76 76 sprintf (format, "%%-%s%c", foo, bar);77 sprintf (format, "%%-%s%c", Size, Type); 77 78 78 79 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
