Changeset 42389 for trunk/Ohana/src/tools/src/fits_insert.c
- Timestamp:
- Feb 8, 2023, 12:17:35 PM (3 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/tools/src/fits_insert.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/tools/src/fits_insert.c
r27491 r42389 85 85 p = gfits_header_field (&header, "COMMENT", Cnumber); 86 86 if (p != (char *) NULL) { 87 strncpy (p, line, 80);87 memcpy (p, line, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 88 88 } 89 89 } … … 108 108 line[80] = 0; 109 109 bzero (keyword, 10); 110 strncpy (keyword, line, 8);110 strncpy_nowarn (keyword, line, 8); 111 111 112 112 /* replace existing keywords, unless this is a COMMENT or HISTORY field */ … … 114 114 p = gfits_header_field (&header, keyword, 1); 115 115 if (p != (char *) NULL) { 116 strncpy (p, line, 80);116 strncpy_nowarn (p, line, 80); 117 117 continue; 118 118 } … … 151 151 exit (1); 152 152 } 153 strncpy (p+80, "END", 3);153 memcpy (p+80, "END", 3); // do not use strncpy_nowarn, do NOT set last byte to NULL 154 154 for (i = 3; i < 80; i++) { p[80+i] = ' '; } 155 155 } 156 156 /* insert the new line here */ 157 strncpy (p, line, 80);157 memcpy (p, line, 80); // do not use strncpy_nowarn, do NOT set last byte to NULL 158 158 } 159 159 if (fclose (f)) {
Note:
See TracChangeset
for help on using the changeset viewer.
