IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2015, 4:49:06 PM (11 years ago)
Author:
eugene
Message:

extensive work on relphot, relastro, uniphot, dvomerge aiming to the construction and calibration of PV3

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libfits/table/F_read_T.c

    r38441 r38986  
    6262
    6363/*********************** fits read ftable data ***********************************/
    64 int gfits_fread_ftable_range (FILE *f, int padIfShort, FTable *table, off_t start, off_t Nrows) {
     64int gfits_fread_ftable_range (FILE *f, int padIfShort, int noSeek, FTable *table, off_t start, off_t Nrows) {
    6565
    6666  off_t Nbytes, Nread, Nskip, Nx, Ny;
     
    7979  Nskip = start * Nx;
    8080  Nbytes = Nrows * Nx;
    81   ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
    82 
    83   fseeko (f, Nskip, SEEK_CUR);
     81
     82  if (table[0].buffer) {
     83    if (table[0].datasize < Nbytes) {
     84      REALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
     85    }
     86  } else {
     87    ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
     88  }
     89
     90  if (!noSeek) {
     91    fseeko (f, Nskip, SEEK_CUR);
     92  }
    8493
    8594  Nread = fread (table[0].buffer, sizeof (char), Nbytes, f);
Note: See TracChangeset for help on using the changeset viewer.