Changeset 42343
- Timestamp:
- Jan 31, 2023, 10:55:31 AM (3 years ago)
- Location:
- branches/eam_branches/ipp-20220316/Ohana/src
- Files:
-
- 72 edited
- 2 moved
-
addstar/src/LoadDataPMM.c (modified) (4 diffs)
-
addstar/src/SkyTableFromBSCIndex.c (modified) (1 diff)
-
addstar/src/SkyTableFromTychoIndex.c (modified) (1 diff)
-
addstar/src/loadatlas_readstars.c (modified) (1 diff)
-
addstar/src/loadgaia_dr2_readstars.c (modified) (1 diff)
-
addstar/src/loadgaia_edr3_readstars.c (modified) (1 diff)
-
addstar/src/loadsupercos_ops.c (modified) (2 diffs)
-
addstar/src/loadukirt_uhs_readstars_ugcs.c (modified) (1 diff)
-
addstar/src/loadukirt_uhs_readstars_ugps.c (modified) (1 diff)
-
addstar/src/loadukirt_uhs_readstars_uhs.c (modified) (1 diff)
-
addstar/src/loadukirt_uhs_readstars_uhs2022.c (modified) (1 diff)
-
addstar/src/loadukirt_uhs_readstars_ulas.c (modified) (1 diff)
-
addstar/src/mkcmf.c (modified) (1 diff)
-
elixir/src/Photcodes.c (modified) (3 diffs)
-
elixir/src/ProcessOps.c (modified) (2 diffs)
-
fixcat/src/aregion.c (modified) (1 diff)
-
imregister/base/fits_scan_nchar.c (modified) (1 diff)
-
imregister/detrend/output.c (modified) (1 diff)
-
imregister/imreg/iminfo.c (modified) (1 diff)
-
imregister/imreg/modify.c (modified) (1 diff)
-
kapa2/src/LoadLabels.c (modified) (1 diff)
-
kapa2/src/LoadTickmarks.c (modified) (1 diff)
-
libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_DEV_3.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_REF.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_SIM.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_PS1_V1.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V2.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V3.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V4.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V5_LOAD.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_PS1_V6.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_elixir.c (modified) (4 diffs)
-
libdvo/src/dvo_convert_loneos.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (2 diffs)
-
libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (2 diffs)
-
libdvo/src/skydb.c (modified) (2 diffs)
-
libdvo/src/skyregion_gsc.c (modified) (1 diff)
-
libfits/header/F_convert_H.c (modified) (3 diffs)
-
libfits/header/F_modify.c (modified) (7 diffs)
-
libfits/header/F_print.c (modified) (3 diffs)
-
libfits/header/F_scan.c (modified) (1 diff)
-
libfits/table/F_get_T_column.c (modified) (3 diffs)
-
libfits/table/F_get_T_value.c (modified) (1 diff)
-
libfits/table/F_table_column.c (modified) (1 diff)
-
libkapa/src/RotFont.c (modified) (2 diffs)
-
libohana/include/ohana.h (modified) (1 diff)
-
libohana/src/findexec.c (modified) (1 diff)
-
libohana/src/string.c (modified) (2 diffs)
-
misc/src/cfhtlog.c (modified) (1 diff)
-
misc/src/fakecmp.c (modified) (3 diffs)
-
misc/src/gtfringetable.c (modified) (1 diff)
-
misc/src/mkfringetable.c (modified) (1 diff)
-
mosastro/src/output.c (modified) (1 diff)
-
nightd/src/misc.c (modified) (1 diff)
-
opihi/cmd.basic/memory.c (modified) (1 diff)
-
opihi/cmd.basic/test/stackmath.tp (moved) (moved from branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.basic/test/stackmath.sh ) (1 diff)
-
opihi/cmd.data/read_vectors.c (modified) (1 diff)
-
opihi/cmd.data/test/histogram.sh (modified) (2 diffs)
-
opihi/cmd.data/test/join.sh (modified) (1 diff)
-
opihi/cmd.data/wd.c (modified) (2 diffs)
-
opihi/cmd.data/write_vectors.c (modified) (1 diff)
-
opihi/dvo/aregion.c (modified) (1 diff)
-
opihi/dvo/find_regions.c (modified) (1 diff)
-
opihi/lib.shell/VectorIO.c (modified) (1 diff)
-
opihi/lib.shell/expand_vectors.c (modified) (3 diffs)
-
opihi/test/tap.tp (moved) (moved from branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.basic/test/tap.sh )
-
opihi/test/tests.sh (modified) (1 diff)
-
tools/src/findexec.c (modified) (1 diff)
-
tools/src/fits_insert.c (modified) (4 diffs)
-
tools/src/mpcorb_predict.c (modified) (1 diff)
-
tools/src/mpcorb_predict_tests.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/LoadDataPMM.c
r40291 r42343 163 163 if (!PMM_CCD_TABLE) abort (); 164 164 165 strncpy (fileID, datafile, 7); 166 fileID[7] = 0; 165 strncpy_nowarn (fileID, datafile, 7); 167 166 168 167 f = fopen (PMM_CCD_TABLE, "r"); … … 177 176 if (strncmp (fileID, &line[FILE_ID_INDEX], 7)) continue; 178 177 179 strncpy (date, &line[DATE_INDEX], 9); 180 date[9] = 0; 181 182 strncpy (timestr, &line[TIME_INDEX], 5); 183 timestr[5] = 0; 184 185 strncpy (RA, &line[RA_INDEX], 6); 186 RA[6] = 0; 187 188 strncpy (DEC, &line[DEC_INDEX], 7); 189 DEC[7] = 0; 190 191 strncpy (emulsion, &line[EMULSION_INDEX], 5); 192 emulsion[5] = 0; 193 194 strncpy (filter, &line[FILTER_INDEX], 6); 195 filter[6] = 0; 196 197 strncpy (EXPTIME, &line[EXPTIME_INDEX], 3); 198 EXPTIME[3] = 0; 178 strncpy_nowarn (date, &line[DATE_INDEX], 9); 179 strncpy_nowarn (timestr, &line[TIME_INDEX], 5); 180 strncpy_nowarn (RA, &line[RA_INDEX], 6); 181 strncpy_nowarn (DEC, &line[DEC_INDEX], 7); 182 strncpy_nowarn (emulsion, &line[EMULSION_INDEX], 5); 183 strncpy_nowarn (filter, &line[FILTER_INDEX], 6); 184 strncpy_nowarn (EXPTIME, &line[EXPTIME_INDEX], 3); 199 185 200 186 image[0].tzero = pmm_date_to_sec (date, timestr); … … 357 343 double h, m, s, ra; 358 344 359 strncpy (tmp, &RA[0], 2); 360 tmp[2] = 0; 361 h = atof (tmp); 362 363 strncpy (tmp, &RA[2], 2); 364 tmp[2] = 0; 365 m = atof (tmp); 366 367 strncpy (tmp, &RA[4], 2); 368 tmp[2] = 0; 369 s = atof (tmp); 345 strncpy_nowarn (tmp, &RA[0], 2); h = atof (tmp); 346 strncpy_nowarn (tmp, &RA[2], 2); m = atof (tmp); 347 strncpy_nowarn (tmp, &RA[4], 2); s = atof (tmp); 370 348 371 349 ra = 15.0 * (h + m / 60.0 + s / 3600.0); … … 379 357 double d, m, s, dec; 380 358 381 strncpy (tmp, &DEC[1], 2); 382 tmp[2] = 0; 383 d = atof (tmp); 384 385 strncpy (tmp, &DEC[3], 2); 386 tmp[2] = 0; 387 m = atof (tmp); 388 389 strncpy (tmp, &DEC[5], 2); 390 tmp[2] = 0; 391 s = atof (tmp); 359 strncpy_nowarn (tmp, &DEC[1], 2); d = atof (tmp); 360 strncpy_nowarn (tmp, &DEC[3], 2); m = atof (tmp); 361 strncpy_nowarn (tmp, &DEC[5], 2); s = atof (tmp); 392 362 393 363 dec = d + m / 60.0 + s / 3600.0; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/SkyTableFromBSCIndex.c
r39318 r42343 35 35 36 36 memset (tycho[i].name, 0, 21); 37 strncpy (tycho[i].name, line, 7); 38 tycho[i].name[7] = 0; 37 strncpy_nowarn (tycho[i].name, line, 7); 39 38 } 40 39 Ntycho = i; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/SkyTableFromTychoIndex.c
r28241 r42343 35 35 36 36 memset (tycho[i].name, 0, 21); 37 strncpy (tycho[i].name, line, 7); 38 tycho[i].name[7] = 0; 37 strncpy_nowarn (tycho[i].name, line, 7); 39 38 } 40 39 Ntycho = i; -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadatlas_readstars.c
r41563 r42343 242 242 // why do I need to copy temp here, does gprint modify the value of temp? 243 243 char temp[32]; 244 strncpy (temp, c0, 32); 245 temp[31] = 0; 244 strncpy_nowarn (temp, c0, 31); 246 245 gprint (GP_ERR, "skip line %s\n\n", temp); 247 246 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadgaia_dr2_readstars.c
r40543 r42343 238 238 // why do I need to copy temp here, does gprint modify the value of temp? 239 239 char temp[32]; 240 strncpy (temp, c0, 32); 241 temp[31] = 0; 240 strncpy_nowarn (temp, c0, 31); 242 241 gprint (GP_ERR, "skip line %s\n\n", temp); 243 242 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadgaia_edr3_readstars.c
r41801 r42343 253 253 // why do I need to copy temp here, does gprint modify the value of temp? 254 254 char temp[32]; 255 strncpy (temp, c0, 32); 256 temp[31] = 0; 255 strncpy_nowarn (temp, c0, 31); 257 256 gprint (GP_ERR, "skip line %s\n\n", temp); 258 257 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadsupercos_ops.c
r38986 r42343 38 38 39 39 Nchar = p2 - p1 - 1; 40 strncpy (emulsion, p1, Nchar); 41 emulsion[Nchar] = 0; 40 strncpy_nowarn (emulsion, p1, Nchar); 42 41 stripwhite (emulsion); 43 42 44 43 Nchar = p3 - p2 - 1; 45 strncpy (filterID, p2, Nchar); 46 filterID[Nchar] = 0; 44 strncpy_nowarn (filterID, p2, Nchar); 47 45 stripwhite (filterID); 48 46 … … 69 67 70 68 char hour[3], minute[3]; 71 strncpy (hour, p1, 2); hour[2] = 0;72 strncpy (minute, p1+2, 2); minute[2] = 0;69 strncpy_nowarn(hour, p1, 2); 70 strncpy_nowarn(minute, p1+2, 2); 73 71 74 72 double minuteF = atof (minute); -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c
r42166 r42343 458 458 // why do I need to copy temp here, does gprint modify the value of temp? 459 459 char temp[32]; 460 strncpy (temp, c0, 32); 461 temp[31] = 0; 460 strncpy_nowarn (temp, c0, 31); 462 461 gprint (GP_ERR, "skip line %s\n\n", temp); 463 462 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c
r42166 r42343 379 379 // why do I need to copy temp here, does gprint modify the value of temp? 380 380 char temp[32]; 381 strncpy (temp, c0, 32); 382 temp[31] = 0; 381 strncpy_nowarn (temp, c0, 31); 383 382 gprint (GP_ERR, "skip line %s\n\n", temp); 384 383 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c
r42166 r42343 201 201 // why do I need to copy temp here, does gprint modify the value of temp? 202 202 char temp[32]; 203 strncpy (temp, c0, 32); 204 temp[31] = 0; 203 strncpy_nowarn (temp, c0, 31); 205 204 gprint (GP_ERR, "skip line %s\n\n", temp); 206 205 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs2022.c
r42212 r42343 260 260 // why do I need to copy temp here, does gprint modify the value of temp? 261 261 char temp[32]; 262 strncpy (temp, c0, 32); 263 temp[31] = 0; 262 strncpy_nowarn (temp, c0, 31); 264 263 gprint (GP_ERR, "skip line %s\n\n", temp); 265 264 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c
r42166 r42343 406 406 // why do I need to copy temp here, does gprint modify the value of temp? 407 407 char temp[32]; 408 strncpy (temp, c0, 32); 409 temp[31] = 0; 408 strncpy_nowarn (temp, c0, 31); 410 409 gprint (GP_ERR, "skip line %s\n\n", temp); 411 410 } -
branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/mkcmf.c
r40291 r42343 559 559 Ns = strlen (simple); 560 560 No = 80 - Ns; 561 strncpy (header.buffer, simple, Ns);561 strncpy_nowarn (header.buffer, simple, Ns); 562 562 memset (&header.buffer[Ns], ' ', No); 563 563 } -
branches/eam_branches/ipp-20220316/Ohana/src/elixir/src/Photcodes.c
r10336 r42343 172 172 173 173 ALLOCATE (root, char, Nbyte + 1); 174 strncpy (root, p1, Nbyte); 175 root[Nbyte] = 0; 174 strncpy_nowarn (root, p1, Nbyte); 176 175 177 176 return (root); … … 195 194 Nbyte = p1-file; 196 195 ALLOCATE (path, char, Nbyte + 1); 197 strncpy (path, file, Nbyte); 198 path[Nbyte] = 0; 196 strncpy_nowarn (path, file, Nbyte); 199 197 200 198 return (path); … … 232 230 Nbyte = (p1 - p2); 233 231 ALLOCATE (path, char, Nbyte + 1); 234 strncpy (path, p2, Nbyte); 235 path[Nbyte] = 0; 232 strncpy_nowarn (path, p2, Nbyte); 236 233 237 234 return (path); -
branches/eam_branches/ipp-20220316/Ohana/src/elixir/src/ProcessOps.c
r27435 r42343 69 69 REALLOCATE (value, char, Nbyte); 70 70 } 71 strncpy (&value[Nout], p1, Ncpy);71 strncpy_nowarn (&value[Nout], p1, Ncpy); 72 72 Nout += Ncpy; 73 73 p2 ++; … … 90 90 REALLOCATE (value, char, Nbyte); 91 91 } 92 strncpy (&value[Nout], p1, Ncpy);92 strncpy_nowarn (&value[Nout], p1, Ncpy); 93 93 Nout += Ncpy; 94 value[Nout] = 0;95 94 } 96 95 -
branches/eam_branches/ipp-20220316/Ohana/src/fixcat/src/aregion.c
r27435 r42343 84 84 Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char"); 85 85 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 86 strncpy (temp, &buffer[i*48], 48); 87 temp[49] = 0; 86 strncpy_nowarn (temp, &buffer[i*48], 48); 88 87 hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]); 89 88 if (RA1 < RA0) RA1 += 360.0; -
branches/eam_branches/ipp-20220316/Ohana/src/imregister/base/fits_scan_nchar.c
r7080 r42343 20 20 21 21 status = gfits_scan (header, field, "%s", N, tmpstr); 22 strncpy (outstr, tmpstr, size - 1); 23 outstr[size-1] = 0; 22 strncpy_nowarn (outstr, tmpstr, size - 1); 24 23 25 24 return (status); -
branches/eam_branches/ipp-20220316/Ohana/src/imregister/detrend/output.c
r40501 r42343 148 148 } 149 149 bzero (key, 33); 150 strncpy (key, p, 32);150 strncpy_nowarn (key, p, 32); 151 151 if ((p = strrchr (key, '.')) != (char *) NULL) *p = 0; 152 152 -
branches/eam_branches/ipp-20220316/Ohana/src/imregister/imreg/iminfo.c
r27590 r42343 91 91 /* force strings to fit in available space (32 bytes) */ 92 92 gfits_scan (&header, CameraKeyword, "%s", 1, line); 93 strncpy (image[0].instrument, line, 31); 94 image[0].instrument[31] = 0; 93 strncpy_nowarn (image[0].instrument, line, 31); 95 94 96 95 gfits_scan (&header, FilterKeyword, "%s", 1, line); 97 96 MatchFilterList (line); 98 strncpy (image[0].filter, line, 31); 99 image[0].filter[31] = 0; 97 strncpy_nowarn (image[0].filter, line, 31); 100 98 101 99 /* header has RA & DEC in decimal degrees */ -
branches/eam_branches/ipp-20220316/Ohana/src/imregister/imreg/modify.c
r34088 r42343 69 69 70 70 if (output.modify_filter) { 71 strncpy (image[i].filter, output.filter, 31);71 strncpy_nowarn (image[i].filter, output.filter, 31); 72 72 } 73 73 -
branches/eam_branches/ipp-20220316/Ohana/src/kapa2/src/LoadLabels.c
r41341 r42343 23 23 24 24 Nbytes = MIN (strlen(label), LABEL_MAXLEN - 1); 25 strncpy (graph[0].label[mode].text, label, Nbytes); 26 label[Nbytes] = 0; 25 strncpy_nowarn (graph[0].label[mode].text, label, Nbytes); 27 26 28 27 FREE (label); -
branches/eam_branches/ipp-20220316/Ohana/src/kapa2/src/LoadTickmarks.c
r16011 r42343 47 47 line[128] = 0; 48 48 ALLOCATE (image[0].tickmarks.objects[Nobjects].text, char, (int) dx + 1); 49 strncpy (image[0].tickmarks.objects[Nobjects].text, line, (int) dx); 50 image[0].tickmarks.objects[Nobjects].text[(int)dx] = 0; 49 strncpy_nowarn (image[0].tickmarks.objects[Nobjects].text, line, (int) dx); 51 50 } 52 51 -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r40291 r42343 230 230 231 231 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 232 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 233 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 232 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 234 233 235 234 out[i].tzero = in[i].tzero; … … 302 301 303 302 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 304 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 305 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 303 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 306 304 307 305 out[i].tzero = in[i].tzero; … … 358 356 359 357 for (i = 0; i < Nvalues; i++) { 360 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 361 out[i].name[31] = 0; // force termination 358 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 362 359 363 360 out[i].code = in[i].code; … … 397 394 398 395 for (i = 0; i < Nvalues; i++) { 399 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 400 out[i].name[31] = 0; // force termination 396 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 401 397 402 398 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r40291 r42343 225 225 226 226 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 227 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 228 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 227 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 229 228 230 229 out[i].tzero = in[i].tzero; … … 294 293 295 294 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 296 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 297 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 295 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 298 296 299 297 out[i].tzero = in[i].tzero; … … 353 351 354 352 for (i = 0; i < Nvalues; i++) { 355 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 356 out[i].name[31] = 0; // force termination 353 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 357 354 358 355 out[i].code = in[i].code; … … 390 387 391 388 for (i = 0; i < Nvalues; i++) { 392 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 393 out[i].name[31] = 0; // force termination 389 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 394 390 395 391 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
r40291 r42343 24 24 25 25 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 26 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 27 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 26 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 28 27 29 28 out[i].tzero = in[i].tzero; … … 88 87 89 88 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 90 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 91 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 89 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 92 90 93 91 out[i].tzero = in[i].tzero; … … 146 144 147 145 for (i = 0; i < Nvalues; i++) { 148 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 149 out[i].name[31] = 0; // force termination 146 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 150 147 151 148 out[i].code = in[i].code; … … 182 179 183 180 for (i = 0; i < Nvalues; i++) { 184 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 185 out[i].name[31] = 0; // force termination 181 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 186 182 187 183 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c
r40291 r42343 153 153 154 154 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 155 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 156 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 155 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 157 156 158 157 out[i].tzero = in[i].tzero; … … 220 219 221 220 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 222 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 223 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 221 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 224 222 225 223 out[i].tzero = in[i].tzero; … … 277 275 278 276 for (i = 0; i < Nvalues; i++) { 279 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 280 out[i].name[31] = 0; // force termination 277 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 281 278 282 279 out[i].code = in[i].code; … … 313 310 314 311 for (i = 0; i < Nvalues; i++) { 315 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 316 out[i].name[31] = 0; // force termination 312 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 317 313 318 314 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c
r40291 r42343 313 313 314 314 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 315 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 316 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 315 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 317 316 318 317 out[i].tzero = in[i].tzero; … … 382 381 383 382 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 384 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 385 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 383 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 386 384 387 385 out[i].tzero = in[i].tzero; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
r40291 r42343 249 249 250 250 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 251 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 252 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 251 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 253 252 254 253 out[i].tzero = in[i].tzero; … … 317 316 318 317 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 319 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 320 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 318 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 321 319 322 320 out[i].tzero = in[i].tzero; … … 375 373 376 374 for (i = 0; i < Nvalues; i++) { 377 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 378 out[i].name[31] = 0; // force termination 375 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 379 376 380 377 out[i].code = in[i].code; … … 411 408 412 409 for (i = 0; i < Nvalues; i++) { 413 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 414 out[i].name[31] = 0; // force termination 410 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 415 411 416 412 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
r40291 r42343 260 260 261 261 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 262 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 263 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 262 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 264 263 265 264 out[i].tzero = in[i].tzero; … … 328 327 329 328 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 330 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 331 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 329 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 332 330 333 331 out[i].tzero = in[i].tzero; … … 391 389 392 390 for (i = 0; i < Nvalues; i++) { 393 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 394 out[i].name[31] = 0; // force termination 391 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 395 392 396 393 out[i].code = in[i].code; … … 427 424 428 425 for (i = 0; i < Nvalues; i++) { 429 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 430 out[i].name[31] = 0; // force termination 426 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 431 427 432 428 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
r40291 r42343 270 270 271 271 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 272 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 273 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 272 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 274 273 275 274 out[i].tzero = in[i].tzero; … … 338 337 339 338 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 340 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 341 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 339 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 342 340 343 341 out[i].tzero = in[i].tzero; … … 401 399 402 400 for (i = 0; i < Nvalues; i++) { 403 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 404 out[i].name[31] = 0; // force termination 401 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 405 402 406 403 out[i].code = in[i].code; … … 437 434 438 435 for (i = 0; i < Nvalues; i++) { 439 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 440 out[i].name[31] = 0; // force termination 436 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 441 437 442 438 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
r40291 r42343 308 308 309 309 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 310 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 311 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 310 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 312 311 313 312 out[i].tzero = in[i].tzero; … … 376 375 377 376 // RAW_IMAGE_NAME_LEN > DVO_IMAGE_NAME_LEN 378 strncpy (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 379 out[i].name[DVO_IMAGE_NAME_LEN - 1] = 0; // force termination 377 strncpy_nowarn (out[i].name, in[i].name, DVO_IMAGE_NAME_LEN - 1); 380 378 381 379 out[i].tzero = in[i].tzero; … … 439 437 440 438 for (i = 0; i < Nvalues; i++) { 441 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 442 out[i].name[31] = 0; // force termination 439 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 443 440 444 441 out[i].code = in[i].code; … … 475 472 476 473 for (i = 0; i < Nvalues; i++) { 477 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 478 out[i].name[31] = 0; // force termination 474 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 479 475 480 476 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r40291 r42343 1134 1134 1135 1135 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 1136 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 1137 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 1136 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 1138 1137 1139 1138 out[i].tzero = in[i].tzero; … … 1203 1202 1204 1203 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 1205 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 1206 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 1204 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 1207 1205 1208 1206 out[i].tzero = in[i].tzero; … … 1267 1265 1268 1266 for (i = 0; i < Nvalues; i++) { 1269 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 1270 out[i].name[31] = 0; // force termination 1267 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 1271 1268 1272 1269 out[i].code = in[i].code; … … 1303 1300 1304 1301 for (i = 0; i < Nvalues; i++) { 1305 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 1306 out[i].name[31] = 0; // force termination 1302 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 1307 1303 1308 1304 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c
r40291 r42343 645 645 646 646 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 647 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 648 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 647 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 649 648 650 649 out[i].tzero = in[i].tzero; … … 714 713 715 714 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 716 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 717 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 715 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 718 716 719 717 out[i].tzero = in[i].tzero; … … 778 776 779 777 for (i = 0; i < Nvalues; i++) { 780 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 781 out[i].name[31] = 0; // force termination 778 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 782 779 783 780 out[i].code = in[i].code; … … 814 811 815 812 for (i = 0; i < Nvalues; i++) { 816 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 817 out[i].name[31] = 0; // force termination 813 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 818 814 819 815 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_PS1_V6.c
r40291 r42343 860 860 861 861 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 862 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 863 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 862 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 864 863 865 864 out[i].tzero = in[i].tzero; … … 927 926 928 927 // RAW_IMAGE_NAME_LEN == DVO_IMAGE_NAME_LEN 929 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 930 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 928 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 931 929 932 930 out[i].tzero = in[i].tzero; … … 990 988 991 989 for (i = 0; i < Nvalues; i++) { 992 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 993 out[i].name[31] = 0; // force termination 990 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 994 991 995 992 out[i].code = in[i].code; … … 1026 1023 1027 1024 for (i = 0; i < Nvalues; i++) { 1028 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 1029 out[i].name[31] = 0; // force termination 1025 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 1030 1026 1031 1027 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_elixir.c
r40291 r42343 217 217 218 218 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 219 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 220 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 219 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 221 220 222 221 out[i].tzero = in[i].tzero; … … 291 290 292 291 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 293 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 294 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 292 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 295 293 296 294 out[i].tzero = in[i].tzero; … … 346 344 347 345 for (i = 0; i < Nvalues; i++) { 348 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 349 out[i].name[31] = 0; // force termination 346 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 350 347 351 348 out[i].code = in[i].code; … … 386 383 387 384 for (i = 0; i < Nvalues; i++) { 388 strncpy (out[i].name, in[i].name, 31); // out[32], in[32] 389 out[i].name[31] = 0; // force termination 385 strncpy_nowarn (out[i].name, in[i].name, 31); // out[32], in[32] 390 386 391 387 out[i].code = in[i].code; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_loneos.c
r40291 r42343 195 195 196 196 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 197 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 198 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 197 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 199 198 200 199 out[i].tzero = in[i].tzero; … … 270 269 271 270 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 272 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 273 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 271 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 274 272 275 273 out[i].tzero = in[i].tzero; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r40291 r42343 238 238 239 239 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 240 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 241 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 240 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 242 241 243 242 out[i].tzero = in[i].tzero; … … 312 311 313 312 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 314 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 315 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 313 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 316 314 317 315 out[i].tzero = in[i].tzero; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r40291 r42343 238 238 239 239 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 240 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 241 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 240 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 242 241 243 242 out[i].tzero = in[i].tzero; … … 312 311 313 312 // RAW_IMAGE_NAME_LEN < DVO_IMAGE_NAME_LEN 314 strncpy (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 315 out[i].name[RAW_IMAGE_NAME_LEN - 1] = 0; // force termination 313 strncpy_nowarn (out[i].name, in[i].name, RAW_IMAGE_NAME_LEN - 1); 316 314 317 315 out[i].tzero = in[i].tzero; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/skydb.c
r38553 r42343 275 275 new[Nnew].depth = 2; 276 276 new[Nnew].child = FALSE; 277 strncpy (root, db[i].name, 5); root[5] = 0;277 strncpy_nowarn (root, db[i].name, 5); 278 278 myAssert (snprintf (new[Nnew].name, 18, "%s/r%04d.cpt", root, Rnumber) < 18, "overflow"); 279 279 Rnumber ++; … … 364 364 db[N].depth = 3; 365 365 db[N].child = FALSE; 366 strncpy (root, db[i].name, 10); root[10] = 0;366 strncpy_nowarn (root, db[i].name, 10); 367 367 myAssert (snprintf (db[N].name, 18, "%s.%02d.cpt", root, Rnumber) < 18, "overflow"); 368 368 Rnumber ++; -
branches/eam_branches/ipp-20220316/Ohana/src/libdvo/src/skyregion_gsc.c
r42116 r42343 254 254 ALLOCATE (regions, SkyRegion, Nregions); 255 255 for (i = 0; i < Nregions; i++) { 256 strncpy (temp, &buffer[i*48], 48); 257 temp[48] = 0; 256 strncpy_nowarn (temp, &buffer[i*48], 48); 258 257 hstgsc_hms_to_deg (&Rmin, &Rmax, &Dmin, &Dmax, &temp[7]); 259 258 if (Dmax < Dmin) SWAP (Dmin, Dmax); -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_convert_H.c
r15487 r42343 11 11 Ns = strlen (line); 12 12 No = 80 - Ns; 13 strncpy (header->buffer, line, Ns);13 strncpy_nowarn (header->buffer, line, Ns); 14 14 memset (&header->buffer[Ns], ' ', No); 15 15 … … 27 27 Ns = strlen (line); 28 28 No = 80 - Ns; 29 strncpy (header->buffer, line, Ns);29 strncpy_nowarn (header->buffer, line, Ns); 30 30 memset (&header->buffer[Ns], ' ', No); 31 31 … … 46 46 Ns = strlen (line); 47 47 No = 80 - Ns; 48 strncpy (header->buffer, line, Ns);48 strncpy_nowarn (header->buffer, line, Ns); 49 49 memset (&header->buffer[Ns], ' ', No); 50 50 -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_modify.c
r42116 r42343 48 48 qe += 3; 49 49 qe = MIN (p + 80, qe); 50 strncpy (comment, qe, p + 80 - qe);50 strncpy_nowarn (comment, qe, p + 80 - qe); 51 51 } 52 52 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 53 53 54 54 /* write the numeric modes */ 55 if (!strcmp (mode, "%d")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; }56 if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); goto found_it; }57 if (!strcmp (mode, "%lld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; }58 if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; }59 if (!strcmp (mode, "%u")) { snprintf (string, 200, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned), comment); goto found_it; }55 if (!strcmp (mode, "%d")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; } 56 if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); goto found_it; } 57 if (!strcmp (mode, "%lld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; } 58 if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); goto found_it; } 59 if (!strcmp (mode, "%u")) { snprintf (string, 200, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned), comment); goto found_it; } 60 60 if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); goto found_it; } 61 61 if (!strcmp (mode, "%llu")) { snprintf (string, 200, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; } 62 62 if (!strcmp (mode, "%Lu")) { snprintf (string, 200, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; } 63 if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; }64 if (!strcmp (mode, "%f")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; }65 if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; }66 if (!strcmp (mode, "%e")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; }67 if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; }68 if (!strcmp (mode, "%g")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; }69 if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; }70 if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %-s ", field, va_arg (argp, intmax_t), comment); goto found_it; }63 if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); goto found_it; } 64 if (!strcmp (mode, "%f")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; } 65 if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); goto found_it; } 66 if (!strcmp (mode, "%e")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; } 67 if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); goto found_it; } 68 if (!strcmp (mode, "%g")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; } 69 if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); goto found_it; } 70 if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %-s ", field, va_arg (argp, intmax_t), comment); goto found_it; } 71 71 72 72 /* string value. Quotes must be at least 8 chars apart */ … … 74 74 char *ptr = va_arg (argp, char *); 75 75 if (!ptr) goto invalid; 76 strncpy (data, ptr, 68);76 strncpy_nowarn (data, ptr, 68); 77 77 snprintf (string, 200, "%-8s= '%-8s' / %-s ", field, data, comment); 78 78 goto found_it; … … 85 85 86 86 found_it: 87 strncpy (p, string, 80);87 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 88 88 va_end (argp); 89 89 return (TRUE); … … 134 134 qe += 3; 135 135 qe = MIN (p + 80, qe); 136 strncpy (comment, qe, p + 80 - qe);136 strncpy_nowarn (comment, qe, p + 80 - qe); 137 137 } 138 138 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ … … 150 150 char *ptr = va_arg (argp, char *); 151 151 if (!ptr) goto invalid; 152 strncpy (data, ptr, 71);152 strncpy_nowarn (data, ptr, 71); 153 153 snprintf (string, 200, "%-8s %-71s", field, data); 154 154 } … … 163 163 if (qs[-1] == 0x27) qs --; 164 164 165 strncpy (data, qs, MAX (MIN (qe - qs, 71), 0));165 strncpy_nowarn (data, qs, MAX (MIN (qe - qs, 71), 0)); 166 166 167 167 char *ptr = va_arg (argp, char *); 168 168 if (!ptr) goto invalid; 169 strncpy (comment, ptr, 80);169 strncpy_nowarn (comment, ptr, 80); 170 170 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 171 171 snprintf (string, 200, "%-8s= %s / %-s", field, data, comment); … … 173 173 } 174 174 175 strncpy (p, string, 80);175 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 176 176 va_end (argp); 177 177 return (TRUE); -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_print.c
r42116 r42343 78 78 79 79 found_it: 80 strncpy (p, string, 80);80 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 81 81 va_end (argp); 82 82 return (TRUE); … … 137 137 if (!ptr) goto invalid; 138 138 bzero (line, 80); 139 strncpy (line, ptr, 71);139 strncpy_nowarn (line, ptr, 71); 140 140 snprintf (string, 200, "%-8s %-71s", field, line); 141 141 } … … 154 154 if (!strcmp (mode, "%C")) goto invalid; 155 155 156 strncpy (p, string, 80);156 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 157 157 158 158 va_end (argp); -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/header/F_scan.c
r39324 r42343 111 111 /* non-data entry (COMMENT, HISTORY) */ 112 112 if (!strcmp (mode, "%S")) { 113 strncpy (va_arg (argp, char *), p + 8, FT_HISTORY_LENGTH);113 strncpy_nowarn (va_arg (argp, char *), p + 8, FT_HISTORY_LENGTH); 114 114 return (TRUE); 115 115 } -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/table/F_get_T_column.c
r38553 r42343 32 32 ALLOCATE (Ivalues, int, table[0].Naxis[1]); 33 33 for (i = 0; i < table[0].Naxis[1]; i++) { 34 strncpy (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar); 35 tmp[Nchar] = 0; 34 strncpy_nowarn (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar); 36 35 Ivalues[i] = atof (tmp); 37 36 } … … 41 40 ALLOCATE (Dvalues, double, table[0].Naxis[1]); 42 41 for (i = 0; i < table[0].Naxis[1]; i++) { 43 strncpy (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar); 44 tmp[Nchar] = 0; 42 strncpy_nowarn (tmp, &table[0].buffer[i*table[0].Naxis[0] + start], Nchar); 45 43 Dvalues[i] = atof (tmp); 46 44 } … … 53 51 for (i = 0; i < table[0].Naxis[1]; i++) { 54 52 ALLOCATE (Cvalues[i], char, N + 1); 55 strncpy (Cvalues[i], &table[0].buffer[i*table[0].Naxis[0] + start], N); 56 Cvalues[i][N] = 0; 53 strncpy_nowarn (Cvalues[i], &table[0].buffer[i*table[0].Naxis[0] + start], N); 57 54 } 58 55 values[0] = (char *) Cvalues; -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/table/F_get_T_value.c
r38553 r42343 26 26 27 27 byte = Y*table[0].Naxis[0] + start; 28 strncpy (tmp, &table[0].buffer[byte], Nchar); 29 tmp[Nchar] = 0; 28 strncpy_nowarn (tmp, &table[0].buffer[byte], Nchar); 30 29 31 30 if (!strcmp (mode, "%d")) *(int *) value = (int) atof (tmp); -
branches/eam_branches/ipp-20220316/Ohana/src/libfits/table/F_table_column.c
r38553 r42343 72 72 73 73 for (i = 0; i < table[0].Naxis[1]; i++) { 74 strncpy (temp, &table[0].buffer[i*table[0].Naxis[0] + start - 1], width); 75 temp[width] = 0; 74 strncpy_nowarn (temp, &table[0].buffer[i*table[0].Naxis[0] + start - 1], width); 76 75 switch (M) { 77 76 case 0: -
branches/eam_branches/ipp-20220316/Ohana/src/libkapa/src/RotFont.c
r41341 r42343 30 30 currentfont = RotFonts[DEFFONT].font; 31 31 currentscale = 1.0; 32 strncpy (currentname, RotFonts[DEFFONT].name, 63); currentname[63] = 0;32 strncpy_nowarn (currentname, RotFonts[DEFFONT].name, 63); 33 33 currentsize = RotFonts[DEFFONT].size; 34 34 } … … 79 79 currentsize = size; 80 80 if (name != currentname) { 81 strncpy (currentname, name, 63); currentname[63] = 0;81 strncpy_nowarn (currentname, name, 63); 82 82 } 83 83 return (TRUE); -
branches/eam_branches/ipp-20220316/Ohana/src/libohana/include/ohana.h
r41468 r42343 296 296 char *strcreate PROTO((char *string)); 297 297 char *strncreate PROTO((char *string, int n)); 298 char *strncpy_nowarn PROTO((char *dest, char *src, size_t n)); 298 299 int strextend PROTO((char **input, char *format,...)) OHANA_FORMAT(printf, 2, 3); 299 300 int scan_line PROTO((FILE *f, char *line)); -
branches/eam_branches/ipp-20220316/Ohana/src/libohana/src/findexec.c
r42144 r42343 291 291 if (e == (char *) NULL) { 292 292 done = TRUE; 293 strncpy (path, c, strlen(c));293 strncpy_nowarn (path, c, strlen(c)); 294 294 } else { 295 strncpy (path, c, e-c);295 strncpy_nowarn (path, c, e-c); 296 296 c = e+1; 297 297 e = strchr (c, ':'); -
branches/eam_branches/ipp-20220316/Ohana/src/libohana/src/string.c
r40549 r42343 42 42 43 43 return (value); 44 } 45 46 // gcc (Ubuntu 20.04) complains when strncpy is used to copy a fraction of a buffer, 47 // potentially skipping the ending NULL. To avoid the error, manually copy 48 // and (to ensure the buffer ends in a NULL) set the last + 1 byte to NUL: 49 // WARNING : len(dest) must be >= n + 1 50 char *strncpy_nowarn (char *dest, char *src, size_t n) { 51 52 size_t i; 53 54 char *d = dest; 55 char *s = src; 56 for (i = 0; i < n && *s != 0; i++, d++, s++) { *d = *s; } 57 for ( ; i <= n; i++, d++) { *d = 0; } 58 59 return dest; 44 60 } 45 61 … … 125 141 ALLOCATE (out, char, N1 + N2 + N3 + 1); 126 142 127 strncpy (out, string, N1); 128 strncpy (&out[N1], with, N2); 129 strncpy (&out[N1+N2], ext, N3); 130 out[N1+N2+N3] = 0; 143 strncpy_nowarn (&out[0], string, N1); 144 strncpy_nowarn (&out[N1], with, N2); 145 strncpy_nowarn (&out[N1+N2], ext, N3); 131 146 132 147 return out; -
branches/eam_branches/ipp-20220316/Ohana/src/misc/src/cfhtlog.c
r18 r42343 303 303 year, month,day,hour,min); 304 304 for (j = 0; j < nprobes; j++) { 305 strncpy(bufstr, data + (14 + probes[j]*9), 9); 306 bufstr[9] =0; 305 strncpy_nowarn(bufstr, data + (14 + probes[j]*9), 9); 307 306 printf("%s ", bufstr); 308 307 } -
branches/eam_branches/ipp-20220316/Ohana/src/misc/src/fakecmp.c
r27435 r42343 81 81 line[80] = 0; 82 82 bzero (keyword, 10); 83 strncpy (keyword, line, 8);83 strncpy_nowarn (keyword, line, 8); 84 84 85 85 /* replace existing keywords, unless this is a COMMENT or HISTORY field */ … … 87 87 p = gfits_header_field (&header, keyword, 1); 88 88 if (p != (char *) NULL) { 89 strncpy (p, line, 80);89 strncpy_nowarn (p, line, 80); 90 90 continue; 91 91 } … … 106 106 107 107 /* insert the new line here */ 108 strncpy (p, line, 80);108 strncpy_nowarn (p, line, 80); 109 109 } 110 110 -
branches/eam_branches/ipp-20220316/Ohana/src/misc/src/gtfringetable.c
r7080 r42343 72 72 N = strlen (p); 73 73 74 strncpy (line, p, N);74 strncpy_nowarn (line, p, N); 75 75 76 76 fprintf (stderr, "%s\n", line); -
branches/eam_branches/ipp-20220316/Ohana/src/misc/src/mkfringetable.c
r14590 r42343 200 200 N = strlen (p); 201 201 202 strncpy (line, p, N);202 strncpy_nowarn (line, p, N); 203 203 204 204 fprintf (stderr, "%s\n", line); -
branches/eam_branches/ipp-20220316/Ohana/src/mosastro/src/output.c
r27435 r42343 17 17 18 18 bzero (outname, 256); 19 strncpy (outname, chip[i].file, N);19 strncpy_nowarn (outname, chip[i].file, N); 20 20 21 21 strcat (outname, ext); -
branches/eam_branches/ipp-20220316/Ohana/src/nightd/src/misc.c
r27611 r42343 208 208 Nchar = e - p; 209 209 ALLOCATE (args[N], char, Nchar + 1); 210 strncpy (args[N], p, Nchar); 211 args[N][Nchar] = 0; 210 strncpy_nowarn (args[N], p, Nchar); 212 211 p = e; 213 212 for (; isspace (*p); p++); -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.basic/memory.c
r41341 r42343 27 27 if (!strcasecmp (argv[1], "checkfree")) { 28 28 ohana_memcheck (1); 29 return (TRUE); 30 } 31 if (!strcasecmp (argv[1], "stats")) { 32 OhanaMemstats memstats = ohana_memstats (0); 33 set_variable ("memory:Ntotal", memstats.Ntotal); 34 set_variable ("memory:Nbytes", memstats.Nbytes); 35 set_variable ("memory:Ngood", memstats.Ngood); 36 set_variable ("memory:Nbad", memstats.Nbad); 29 37 return (TRUE); 30 38 } -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.basic/test/stackmath.tp
r42342 r42343 1 1 2 input tap.sh2 input ../../test/tap.tp 3 3 4 4 macro go -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/read_vectors.c
r42082 r42343 385 385 if (!lineStatus && VERBOSE) { 386 386 char temp[32]; 387 strncpy (temp, c0, 32); 388 temp[31] = 0; 387 strncpy_nowarn (temp, c0, 31); 389 388 gprint (GP_ERR, "skip line %s\n\n", temp); 390 389 } -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/test/histogram.sh
r20936 r42343 35 35 local i 36 36 37 list word -x "ps -p $PID -o rss" 38 $startmem = $word:1 37 create xhis 0 10 0.1 38 $i = 1 39 40 memory stats 41 $startmem = $memory:Ntotal 39 42 40 43 for i 0 1000 … … 42 45 end 43 46 44 list word -x "ps -p $PID -o rss"45 $endmem = $ word:147 memory stats 48 $endmem = $memory:Ntotal 46 49 47 50 $PASS = 1 -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/test/join.sh
r36084 r42343 21 21 22 22 join ID1 ID2 23 24 mana: for i 0 index1[]25 >> echo index1[$i] index2[$i]26 >> end27 0 228 2 129 4 030 5 331 mana: join ID1 ID2 -outer32 mana: vectors33 N name size34 0 ID1 6 (INT)35 1 val1 6 (FLT)36 2 ID2 4 (INT)37 3 val 4 (FLT)38 4 index1 6 (INT)39 5 index2 4 (INT)40 mana: for i 0 index1[]41 >> echo index1[$i]42 >> end43 244 -145 146 -147 048 349 mana: echo ID1[2]50 351 mana: echo ID1[0] ID2[2]52 1 153 mana: for i 0 index1[]54 >> if (index1[$i] == -1) continue55 >> $N = index1[$i]56 >> echo $i index1[$i] ID1[$i] ID2[$N]57 >> end58 0 2 1 159 2 1 3 360 4 0 5 561 5 3 6 662 mana: for i 0 index2[]63 >> if (index2[$i] == -1) continue64 >> $N = index2[$i]65 >> echo $i index2[$i] ID2[$i] ID1[$N]66 >> end67 0 4 5 568 1 2 3 369 2 0 1 170 3 5 6 671 mana:72 73 # if ((xvec[1024] != 17) || (yvec[1024] != 100))74 # $PASS = 075 # echo "Value mismatch: xvec[1024] yvec[1024] (should be 17,100)"76 # end77 #78 # imhist -q buff xvec yvec -region 40 0 25 10 -range 0 1079 #80 # if ((xvec[1024] != 10) || (yvec[1024] != 100))81 # $PASS = 082 # echo "Value mismatch: xvec[1024] yvec[1024] (should be 10,100)"83 # end84 23 85 24 end -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/wd.c
r41674 r42343 115 115 Ns = strlen (simple); 116 116 No = 80 - Ns; 117 strncpy (temp_header.buffer, simple, Ns);117 strncpy_nowarn (temp_header.buffer, simple, Ns); 118 118 memset (&temp_header.buffer[Ns], ' ', No); 119 119 } … … 275 275 return (f); 276 276 } 277 278 279 /// /* fix up header */280 /// {281 /// static char simple[] = "XTENSION= 'IMAGE ' / Image extension";282 /// int Ns, No;283 /// Ns = strlen (simple);284 /// No = 80 - Ns;285 /// strncpy (temp_header.buffer, simple, Ns);286 /// memset (&temp_header.buffer[Ns], ' ', No);287 /// }288 ///289 /// /* position to end of file to write new extend */290 /// fseeko (f, 0LL, SEEK_END);291 /// nbytes = fwrite (temp_header.buffer, 1, temp_header.datasize, f);292 /// fclose (f);293 /// if (nbytes != temp_header.datasize) {294 /// gprint (GP_ERR, "failed to write file\n");295 /// status = FALSE;296 /// goto done1;297 /// }298 ///299 /// } -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/write_vectors.c
r42166 r42343 214 214 /* identify type (%NNNNd %NNNNf) */ 215 215 for (p2 = p1 + 1; (*p2 == '.') || (*p2 == '-') || (*p2 == '+') || (*p2 == ' ') || isdigit(*p2); p2++); 216 strncpy (fmtlist[j], p0, p2 - p0 + 1);216 strncpy_nowarn (fmtlist[j], p0, p2 - p0 + 1); 217 217 switch (*p2) { 218 218 case 'e': -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/dvo/aregion.c
r27435 r42343 49 49 fread (buffer, 1, 48*NDecLines[NBigDec], f); 50 50 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 51 strncpy (temp, &buffer[i*48], 48); 52 temp[49] = 0; 51 strncpy_nowarn (temp, &buffer[i*48], 48); 53 52 hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]); 54 53 if (RA1 < RA0) RA1 += 360.0; -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/dvo/find_regions.c
r27435 r42343 100 100 fread (buffer, 48*NDecLines[NBigDec + j], 1, f); 101 101 for (i = 0; (i < NDecLines[NBigDec + j]); i++) { 102 strncpy (temp, &buffer[i*48], 48); 103 temp[49] = 0; 102 strncpy_nowarn (temp, &buffer[i*48], 48); 104 103 hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]); 105 104 if (RA1 < RA0) RA1 += 360.0; -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/lib.shell/VectorIO.c
r42166 r42343 261 261 memset (endptr, ' ', FT_LINE_LENGTH); 262 262 263 strncpy (endptr, newline, 80);263 strncpy_nowarn (endptr, newline, 80); 264 264 endptr += FT_LINE_LENGTH; 265 265 -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/lib.shell/expand_vectors.c
r42165 r42343 51 51 52 52 n = L - line; 53 strncpy (newline, line, n);53 strncpy_nowarn (newline, line, n); 54 54 N = newline + n; 55 55 J = 0; … … 256 256 257 257 n = (int) (w - L); 258 strncpy (N, L, n);258 strncpy_nowarn (N, L, n); 259 259 N += n; 260 260 n = strlen (strValue); 261 strncpy (N, strValue, n);261 strncpy_nowarn (N, strValue, n); 262 262 N += n; 263 263 L = q + 1; … … 274 274 275 275 n = strlen (L); 276 strncpy (N, L, n); 277 N[n] = 0; 276 strncpy_nowarn (N, L, n); 278 277 free (line); 279 278 return (newline); -
branches/eam_branches/ipp-20220316/Ohana/src/opihi/test/tests.sh
r41470 r42343 53 53 for Tj 0 $testscripts:n 54 54 if ($VERBOSE > 1) 55 echo " running $testscripts:$Tj"55 echo " ----- running $testscripts:$Tj -----" 56 56 end 57 57 runtests $testscripts:$Tj -
branches/eam_branches/ipp-20220316/Ohana/src/tools/src/findexec.c
r12333 r42343 101 101 done = TRUE; 102 102 bzero (path, 256); 103 strncpy (path, c, strlen(c));103 strncpy_nowarn (path, c, strlen(c)); 104 104 } else { 105 105 bzero (path, 256); 106 strncpy (path, c, e-c);106 strncpy_nowarn (path, c, e-c); 107 107 c = e+1; 108 108 e = strchr (c, ':'); -
branches/eam_branches/ipp-20220316/Ohana/src/tools/src/fits_insert.c
r27491 r42343 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)) { -
branches/eam_branches/ipp-20220316/Ohana/src/tools/src/mpcorb_predict.c
r42076 r42343 775 775 // set the byte after the range to NULL and scanf the values. or just use strtod as needed: 776 776 777 strncpy (planet->ID, line, 7); planet->ID[7] = 0;777 strncpy_nowarn (planet->ID, line, 7); 778 778 779 779 char *endptr; -
branches/eam_branches/ipp-20220316/Ohana/src/tools/src/mpcorb_predict_tests.c
r41713 r42343 1059 1059 // set the byte after the range to NULL and scanf the values. or just use strtod as needed: 1060 1060 1061 strncpy (planet->ID, line, 7); planet->ID[7] = 0;1061 strncpy_nowarn (planet->ID, line, 7); 1062 1062 1063 1063 MPC_DOUBLE (planet->mean_anomaly, 27, 35);
Note:
See TracChangeset
for help on using the changeset viewer.
