Changeset 38441 for trunk/Ohana/src/libfits/header/F_modify.c
- Timestamp:
- Jun 12, 2015, 6:18:23 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/libfits/header/F_modify.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ohana.20150429 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/libfits/header/F_modify.c
r34577 r38441 48 48 strncpy (comment, qe, p + 80 - qe); 49 49 } 50 gfits_pad_ending (comment, ' ', 82); /* comment must contain spaces to the end */50 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 51 51 52 52 /* write the numeric modes */ … … 134 134 strncpy (comment, qe, p + 80 - qe); 135 135 } 136 gfits_pad_ending (comment, ' ', 82); /* comment must contain spaces to the end */136 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 137 137 138 138 /* write the boolean mode */ … … 166 166 if (!ptr) goto invalid; 167 167 strncpy (comment, ptr, 80); 168 gfits_pad_ending (comment, ' ', 82); /* comment must contain spaces to the end */168 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 169 169 snprintf (string, 81, "%-8s= %s / %-s", field, data, comment); 170 170 /* this will keep the original line, but truncate the comment */ … … 296 296 */ 297 297 298 // XXX this is an absurd patch on a gcc bug: memset has a problem is value != 0 and N is constant 299 void myMemset (char *ptr, int value, size_t N) { 300 301 char *p = ptr; 302 303 size_t i = 0; 304 for (i = 0; i < N; i++, p++) { 305 *p = value; 306 } 307 } 308 298 309 /* fill 'line' with Nbyte space from first NULL to last byte with value */ 299 310 void gfits_pad_ending (char *line, char value, int Nbyte) { 300 301 char *p;302 int N;303 311 304 312 line[Nbyte-1] = 0; 305 313 306 p = line + strlen (line);307 N = MAX (Nbyte - strlen (line) - 1, 0);308 m emset (p, value, N);314 char *p = line + strlen (line); 315 size_t N = MAX (Nbyte - strlen (line) - 1, 0); 316 myMemset (p, value, N); 309 317 } 310 318
Note:
See TracChangeset
for help on using the changeset viewer.
