IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2017, 12:47:22 PM (9 years ago)
Author:
eugene
Message:

mostly harmless changes to track down dvopsps segfaults: watch out for Bzero,Bscale in F_set_column.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20170809/src/libfits/header/F_create_H.c

    r34577 r40113  
    11# include <ohana.h>
    22# include <gfitsio.h>
    3 # define NBYTES 2880
    43
    54/******************** fits create header ***********************************/
     
    98  char axis[10];
    109 
    11   header[0].datasize = NBYTES;
     10  header[0].datasize = FT_RECORD_SIZE;
    1211
    13   ALLOCATE (header[0].buffer, char, NBYTES);
     12  ALLOCATE (header[0].buffer, char, FT_RECORD_SIZE);
    1413
    15   for (i = 0; i < NBYTES; i++)
    16     header[0].buffer[i] = ' ';
     14  // XXX this is just slightly suspicious : I am not ending the buffer with a NULL.  if I
     15  // use any string operations on it then they can run past the end.
     16  for (i = 0; i < FT_RECORD_SIZE; i++) header[0].buffer[i] = ' ';
    1717  strncpy (header[0].buffer, "END", 3);
    1818
Note: See TracChangeset for help on using the changeset viewer.