IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2007, 3:42:40 PM (19 years ago)
Author:
eugene
Message:

handle i/o errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_read_T.c

    r15743 r15751  
    5252
    5353  int Nbytes, Nread;
     54  char string[128];
    5455
    5556  /* find buffer size */
     
    5960  Nread = fread (table[0].buffer, sizeof (char), Nbytes, f);
    6061  if (Nread != Nbytes) {
    61     perror ("fits read error");
    62     gfits_free_table  (table);
    63     return (FALSE);
     62    snprintf (string, 128, "FITS file is short (%s)", __func__);
     63    perror (string);
     64    if (Nread < gfits_data_min_size (table[0].header)) {
     65      fprintf (stderr, "error: fits read error in %s, read %d, need %d\n", __func__, Nread, gfits_data_min_size (table[0].header));
     66      gfits_free_table  (table);
     67      return (FALSE);
     68    }
     69    fprintf (stderr, "warning: file missing pad\n");
    6470  }
    6571  table[0].size = Nbytes;
Note: See TracChangeset for help on using the changeset viewer.