- Timestamp:
- Aug 9, 2017, 12:47:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170809/src/libfits/header/F_create_H.c
r34577 r40113 1 1 # include <ohana.h> 2 2 # include <gfitsio.h> 3 # define NBYTES 28804 3 5 4 /******************** fits create header ***********************************/ … … 9 8 char axis[10]; 10 9 11 header[0].datasize = NBYTES;10 header[0].datasize = FT_RECORD_SIZE; 12 11 13 ALLOCATE (header[0].buffer, char, NBYTES);12 ALLOCATE (header[0].buffer, char, FT_RECORD_SIZE); 14 13 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] = ' '; 17 17 strncpy (header[0].buffer, "END", 3); 18 18
Note:
See TracChangeset
for help on using the changeset viewer.
