Changeset 42389
- Timestamp:
- Feb 8, 2023, 12:17:35 PM (3 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 deleted
- 176 edited
- 10 copied
-
. (modified) (1 prop)
-
Makefile.Common (modified) (1 diff)
-
Makefile.System.in (modified) (1 diff)
-
src/addstar/Makefile (modified) (1 diff)
-
src/addstar/doc/ukirt.gcs.txt (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/addstar/doc/ukirt.gcs.txt )
-
src/addstar/doc/ukirt.gps.txt (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/addstar/doc/ukirt.gps.txt )
-
src/addstar/doc/ukirt.las.txt (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/addstar/doc/ukirt.las.txt )
-
src/addstar/doc/ukirt.uhs.txt (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/addstar/doc/ukirt.uhs.txt )
-
src/addstar/include/WISE.h (modified) (2 diffs)
-
src/addstar/include/skycells.h (modified) (1 diff)
-
src/addstar/include/ukirt_uhs.h (modified) (2 diffs)
-
src/addstar/src/ConfigInit_skycells.c (modified) (1 diff)
-
src/addstar/src/LoadDataPMM.c (modified) (4 diffs)
-
src/addstar/src/ReadStarsUKIRT.c (modified) (1 diff)
-
src/addstar/src/SkyTableFromBSCIndex.c (modified) (1 diff)
-
src/addstar/src/SkyTableFromTychoIndex.c (modified) (1 diff)
-
src/addstar/src/args_loadukirt_uhs.c (modified) (2 diffs)
-
src/addstar/src/args_loadwise.c (modified) (1 diff)
-
src/addstar/src/fakeimage.c (modified) (3 diffs)
-
src/addstar/src/find_matches_refstars.c (modified) (2 diffs)
-
src/addstar/src/getusno.c (modified) (1 diff)
-
src/addstar/src/getusnob.c (modified) (1 diff)
-
src/addstar/src/loadatlas_readstars.c (modified) (1 diff)
-
src/addstar/src/loadgaia_dr2_readstars.c (modified) (1 diff)
-
src/addstar/src/loadgaia_edr3_readstars.c (modified) (1 diff)
-
src/addstar/src/loadsupercos_ops.c (modified) (2 diffs)
-
src/addstar/src/loadsupercos_plates.c (modified) (1 diff)
-
src/addstar/src/loadukirt_uhs_readstars.c (modified) (1 diff)
-
src/addstar/src/loadukirt_uhs_readstars_ugcs.c (modified) (1 diff)
-
src/addstar/src/loadukirt_uhs_readstars_ugps.c (modified) (1 diff)
-
src/addstar/src/loadukirt_uhs_readstars_uhs.c (modified) (1 diff)
-
src/addstar/src/loadukirt_uhs_readstars_uhs2022.c (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs2022.c )
-
src/addstar/src/loadukirt_uhs_readstars_ulas.c (modified) (1 diff)
-
src/addstar/src/loadwise_ops.c (modified) (1 diff)
-
src/addstar/src/loadwise_rawdata.c (modified) (5 diffs)
-
src/addstar/src/loadwise_star_full.c (modified) (5 diffs)
-
src/addstar/src/mkcmf.c (modified) (1 diff)
-
src/addstar/src/sky_tessalation.c (modified) (12 diffs)
-
src/delstar/src/delete_duplicate_images.c (modified) (3 diffs)
-
src/delstar/src/delete_fix_LAP.c (modified) (5 diffs)
-
src/delstar/src/delete_fix_LAP_edges.c (modified) (2 diffs)
-
src/delstar/src/delete_fix_LAP_edges_delete.c (modified) (3 diffs)
-
src/delstar/src/delete_photcodes.c (modified) (3 diffs)
-
src/dvomerge/src/dvorepairFixStackIDs.c (modified) (1 diff)
-
src/dvomerge/src/dvorepairFixWarpIDs.c (modified) (1 diff)
-
src/dvomerge/src/dvosecfilt_catalogs.c (modified) (3 diffs)
-
src/dvopsps/src/insert_FGshape_dvopsps.c (modified) (2 diffs)
-
src/dvopsps/src/insert_FWobjects_dvopsps.c (modified) (2 diffs)
-
src/elixir/src/ConfigInit.c (modified) (1 diff)
-
src/elixir/src/Photcodes.c (modified) (5 diffs)
-
src/elixir/src/ProcessOps.c (modified) (2 diffs)
-
src/fakeastro/src/AstromOffsetMapOps.c (modified) (1 diff)
-
src/fakeastro/src/ConfigInit.c (modified) (2 diffs)
-
src/fakeastro/src/save_fakestars.c (modified) (1 diff)
-
src/fixcat/src/aregion.c (modified) (1 diff)
-
src/gastro/src/getusno.c (modified) (4 diffs)
-
src/gastro2/src/getusno.c (modified) (4 diffs)
-
src/gastro2/src/getusnob.c (modified) (4 diffs)
-
src/getstar/src/ConfigInit.c (modified) (2 diffs)
-
src/getstar/src/ConfigInit_coords.c (modified) (1 diff)
-
src/getstar/src/ConfigInit_extract.c (modified) (1 diff)
-
src/getstar/src/ConfigInit_overlaps.c (modified) (1 diff)
-
src/imregister/base/ConfigInit.c (modified) (6 diffs)
-
src/imregister/base/fits_scan_nchar.c (modified) (1 diff)
-
src/imregister/detrend/entry.c (modified) (4 diffs)
-
src/imregister/detrend/output.c (modified) (1 diff)
-
src/imregister/imreg/args.imregister.c (modified) (1 diff)
-
src/imregister/imreg/iminfo.c (modified) (1 diff)
-
src/imregister/imreg/modify.c (modified) (1 diff)
-
src/imregister/include/imregister.h (modified) (2 diffs)
-
src/imregister/photreg/getImageData.c (modified) (1 diff)
-
src/imregister/src/photcode-table.c (modified) (2 diffs)
-
src/kapa2/cmaps (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/kapa2/cmaps )
-
src/kapa2/src/LoadLabels.c (modified) (1 diff)
-
src/kapa2/src/LoadTickmarks.c (modified) (1 diff)
-
src/libdvo/include/dvodb.h (modified) (3 diffs)
-
src/libdvo/src/coordops.c (modified) (2 diffs)
-
src/libdvo/src/dbFields.c (modified) (1 diff)
-
src/libdvo/src/dvo_convert_PS1_DEV_1.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_DEV_2.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_DEV_3.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_REF.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_SIM.c (modified) (2 diffs)
-
src/libdvo/src/dvo_convert_PS1_V1.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V2.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V3.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V4.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V5.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V5_LOAD.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_PS1_V6.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_elixir.c (modified) (4 diffs)
-
src/libdvo/src/dvo_convert_loneos.c (modified) (2 diffs)
-
src/libdvo/src/dvo_convert_panstarrs_DEV_0.c (modified) (2 diffs)
-
src/libdvo/src/dvo_convert_panstarrs_DEV_1.c (modified) (2 diffs)
-
src/libdvo/src/skydb.c (modified) (2 diffs)
-
src/libdvo/src/skyregion_gsc.c (modified) (2 diffs)
-
src/libfits/header/F_convert_H.c (modified) (3 diffs)
-
src/libfits/header/F_create_H.c (modified) (2 diffs)
-
src/libfits/header/F_modify.c (modified) (11 diffs)
-
src/libfits/header/F_print.c (modified) (8 diffs)
-
src/libfits/header/F_scan.c (modified) (1 diff)
-
src/libfits/matrix/F_compress_M.c (modified) (2 diffs)
-
src/libfits/matrix/F_uncompress_M.c (modified) (2 diffs)
-
src/libfits/table/F_create_TH.c (modified) (1 diff)
-
src/libfits/table/F_get_T_column.c (modified) (3 diffs)
-
src/libfits/table/F_get_T_value.c (modified) (1 diff)
-
src/libfits/table/F_table_column.c (modified) (1 diff)
-
src/libkapa/src/RotFont.c (modified) (2 diffs)
-
src/libohana/include/ohana.h (modified) (1 diff)
-
src/libohana/src/findexec.c (modified) (2 diffs)
-
src/libohana/src/string.c (modified) (2 diffs)
-
src/misc/src/cfhtlog.c (modified) (1 diff)
-
src/misc/src/fakecmp.c (modified) (3 diffs)
-
src/misc/src/gtfringetable.c (modified) (1 diff)
-
src/misc/src/mkfringetable.c (modified) (1 diff)
-
src/mosastro/src/getstone.c (modified) (1 diff)
-
src/mosastro/src/getusno.c (modified) (4 diffs)
-
src/mosastro/src/getusnob.c (modified) (4 diffs)
-
src/mosastro/src/output.c (modified) (1 diff)
-
src/nightd/include/nightd.h (modified) (1 diff)
-
src/nightd/src/GetStatus.c (modified) (4 diffs)
-
src/nightd/src/misc.c (modified) (1 diff)
-
src/opihi/Makefile.Common (modified) (1 diff)
-
src/opihi/cmd.basic/list.c (modified) (16 diffs)
-
src/opihi/cmd.basic/memory.c (modified) (1 diff)
-
src/opihi/cmd.basic/run_while.c (modified) (2 diffs)
-
src/opihi/cmd.basic/test/stackmath.sh (deleted)
-
src/opihi/cmd.basic/test/stackmath.tp (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.basic/test/stackmath.tp )
-
src/opihi/cmd.basic/test/tap.sh (deleted)
-
src/opihi/cmd.data/Makefile (modified) (2 diffs)
-
src/opihi/cmd.data/cursor.c (modified) (1 diff)
-
src/opihi/cmd.data/init.c (modified) (4 diffs)
-
src/opihi/cmd.data/limits.c (modified) (3 diffs)
-
src/opihi/cmd.data/opihi_size.c (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/opihi_size.c )
-
src/opihi/cmd.data/rdjpg.c (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/rdjpg.c )
-
src/opihi/cmd.data/read_vectors.c (modified) (1 diff)
-
src/opihi/cmd.data/reindex.c (modified) (1 diff)
-
src/opihi/cmd.data/subset.c (modified) (3 diffs)
-
src/opihi/cmd.data/svd.c (modified) (1 diff)
-
src/opihi/cmd.data/test/histogram.sh (modified) (2 diffs)
-
src/opihi/cmd.data/test/join.sh (modified) (1 diff)
-
src/opihi/cmd.data/threshold.c (modified) (6 diffs)
-
src/opihi/cmd.data/tvcolors.c (modified) (1 diff)
-
src/opihi/cmd.data/wd.c (modified) (2 diffs)
-
src/opihi/cmd.data/write_vectors.c (modified) (1 diff)
-
src/opihi/dvo/aregion.c (modified) (1 diff)
-
src/opihi/dvo/coordmosaic.c (modified) (2 diffs)
-
src/opihi/dvo/elixir.c (modified) (2 diffs)
-
src/opihi/dvo/find_regions.c (modified) (1 diff)
-
src/opihi/include/dvomath.h (modified) (1 diff)
-
src/opihi/include/pcontrol.h (modified) (1 diff)
-
src/opihi/lib.data/svdcmp.c (modified) (10 diffs)
-
src/opihi/lib.data/svdcmp_bond_new.c (modified) (1 diff)
-
src/opihi/lib.shell/VectorIO.c (modified) (1 diff)
-
src/opihi/lib.shell/evaluate_stack.c (modified) (1 diff)
-
src/opihi/lib.shell/expand_vectors.c (modified) (4 diffs)
-
src/opihi/lib.shell/stack_math.c (modified) (1 diff)
-
src/opihi/pantasks/controller_status.c (modified) (1 diff)
-
src/opihi/pantasks/pantasks_server.c.in (modified) (1 diff)
-
src/opihi/pcontrol/CheckSystem.c (modified) (2 diffs)
-
src/opihi/pcontrol/pcontrol.c.in (modified) (3 diffs)
-
src/opihi/pcontrol/test/linesize.sh (modified) (2 diffs)
-
src/opihi/test/tap.tp (copied) (copied from branches/eam_branches/ipp-20220316/Ohana/src/opihi/test/tap.tp )
-
src/opihi/test/tests.sh (modified) (1 diff)
-
src/photdbc/src/ConfigInit.c (modified) (3 diffs)
-
src/photdbc/src/copy_images.c (modified) (2 diffs)
-
src/relastro/src (modified) (1 prop)
-
src/relastro/src/ConfigInit.c (modified) (2 diffs)
-
src/relastro/src/FrameCorrection.c (modified) (3 diffs)
-
src/relastro/src/ICRF.c (modified) (1 diff)
-
src/relastro/src/assign_images.c (modified) (1 diff)
-
src/relastro/src/bcatalog.c (modified) (2 diffs)
-
src/relastro/src/launch_region_hosts.c (modified) (2 diffs)
-
src/relastro/src/load_images.c (modified) (2 diffs)
-
src/relastro/src/relastro_parallel_images.c (modified) (1 diff)
-
src/relastro/src/share_images_pos.c (modified) (2 diffs)
-
src/relphot (modified) (1 prop)
-
src/relphot/include/relphot.h (modified) (1 diff)
-
src/relphot/src/args.c (modified) (1 diff)
-
src/relphot/src/bcatalog.c (modified) (3 diffs)
-
src/relphot/src/save_images.c (modified) (2 diffs)
-
src/tools/src/findexec.c (modified) (1 diff)
-
src/tools/src/fits_insert.c (modified) (4 diffs)
-
src/tools/src/fits_to_mysql.c (modified) (6 diffs)
-
src/tools/src/mpcorb_predict.c (modified) (1 diff)
-
src/tools/src/mpcorb_predict_tests.c (modified) (1 diff)
-
src/uniphot/src/ConfigInit.c (modified) (1 diff)
-
src/uniphot/src/load_zpt_table.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/Makefile.Common
r41492 r42389 84 84 @echo "" 85 85 86 # USE THIS? -Wl,--allow-multiple-definition 87 86 88 $(LIB)/%.$(ARCH).so: 87 89 @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi 88 90 rm -f $@ 89 gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc 91 # gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc 92 gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc -Wl,--allow-multiple-definition 90 93 @echo "compiled shared library $*" 91 94 @echo "" -
trunk/Ohana/Makefile.System.in
r12842 r42389 17 17 CFLAGS = @CFLAGS@ 18 18 CPPFLAGS = @CPPFLAGS@ 19 LDFLAGS = @LDFLAGS@ 19 LDFLAGS = @LDFLAGS@ -Wl,--allow-multiple-definition 20 20 DLLTYPE = @DLLTYPE@ 21 21 -
trunk/Ohana/src/addstar/Makefile
r41563 r42389 358 358 $(SRC)/loadukirt_uhs_readstars_ugps.$(ARCH).o \ 359 359 $(SRC)/loadukirt_uhs_readstars_ulas.$(ARCH).o \ 360 $(SRC)/loadukirt_uhs_readstars_uhs2022.$(ARCH).o \ 360 361 $(SRC)/loadukirt_uhs_table.$(ARCH).o \ 361 362 $(SRC)/parse_csv.$(ARCH).o \ -
trunk/Ohana/src/addstar/include/WISE.h
r42146 r42389 21 21 short WISE_W1, WISE_W2, WISE_W3, WISE_W4; 22 22 23 double RA_SYS_OFFRAW; 24 double DE_SYS_OFFSET; 25 double uRA_SYS_OFFSET; 26 double uDE_SYS_OFFSET; 27 23 28 enum {MODE_NONE, MODE_CATWISE, MODE_ALLWISE, MODE_ALLSKY, MODE_PRELIM}; 24 29 int MODE; … … 38 43 int loadwise_star_allsky (Measure *measure, char *line, int Nmax); 39 44 int loadwise_star_allwise (Measure *measure, char *line, int Nmax); 40 int loadwise_star_catwise ( Measure *measure, char *line, int Nmax, double Rs, double Ds);45 int loadwise_star_catwise (Average *average, Measure *measure, char *line, int Nmax, WISE_Stars *tstars); 41 46 42 47 char *nextWISEfield (char *line); -
trunk/Ohana/src/addstar/include/skycells.h
r40528 r42389 35 35 36 36 /* globals which define database info / data sources (KEEP) */ 37 char ImageCat[ 256];37 char ImageCat[512]; 38 38 char GSCFILE[256]; 39 39 char CATDIR[256]; -
trunk/Ohana/src/addstar/include/ukirt_uhs.h
r42131 r42389 1 1 2 typedef enum {UKIRT_MODE_NONE, UKIRT_MODE_UHS, UKIRT_MODE_UGCS, UKIRT_MODE_UGPS, UKIRT_MODE_ULAS } UkirtMode;2 typedef enum {UKIRT_MODE_NONE, UKIRT_MODE_UHS, UKIRT_MODE_UGCS, UKIRT_MODE_UGPS, UKIRT_MODE_ULAS, UKIRT_MODE_UHS2022} UkirtMode; 3 3 4 4 # define NSTARS_MAX 10000000 … … 55 55 UKIRT_Stars *loadukirt_uhs_readstars_ulas (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars); 56 56 UKIRT_Stars *loadukirt_uhs_readstars_uhs (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars); 57 UKIRT_Stars *loadukirt_uhs_readstars_uhs2022 (FILE *f, char *buffer, int *nstart, AddstarClientOptions *options, int *nstars); 57 58 58 59 -
trunk/Ohana/src/addstar/src/ConfigInit_skycells.c
r33719 r42389 6 6 7 7 char *config, *file; 8 char CatdirPhotcodeFile[ 256];9 char MasterPhotcodeFile[ 256];8 char CatdirPhotcodeFile[512]; 9 char MasterPhotcodeFile[512]; 10 10 11 11 /*** load configuration info ***/ -
trunk/Ohana/src/addstar/src/LoadDataPMM.c
r40291 r42389 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; -
trunk/Ohana/src/addstar/src/ReadStarsUKIRT.c
r40520 r42389 66 66 } 67 67 68 char filter[ 80];68 char filter[50]; 69 69 if (!gfits_scan (header, "FILTER", "%s", 1, filter)) { 70 70 fprintf (stderr, "missing FILTER\n"); -
trunk/Ohana/src/addstar/src/SkyTableFromBSCIndex.c
r39318 r42389 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; -
trunk/Ohana/src/addstar/src/SkyTableFromTychoIndex.c
r28241 r42389 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; -
trunk/Ohana/src/addstar/src/args_loadukirt_uhs.c
r41341 r42389 34 34 UKIRT_MODE = UKIRT_MODE_ULAS; 35 35 UKIRT_NFILTER = 5; 36 remove_argument (N, argc, argv); 37 } 38 if ((N = get_argument (*argc, argv, "-uhs2022"))) { 39 UKIRT_MODE = UKIRT_MODE_UHS2022; 40 UKIRT_NFILTER = 2; 36 41 remove_argument (N, argc, argv); 37 42 } … … 152 157 static void help () { 153 158 154 fprintf (stderr, "USAGE: loadukirt_uhs [options] (file) [-uhs | -ugcs | -ulas | -ugps ] [..more files]\n");159 fprintf (stderr, "USAGE: loadukirt_uhs [options] (file) [-uhs | -ugcs | -ulas | -ugps | -uhs2022] [..more files]\n"); 155 160 fprintf (stderr, " add data from UKIRT CSV file to DVO\n"); 156 fprintf (stderr, " mode is required : -uhs | -ugcs | -ulas | -ugps \n\n");161 fprintf (stderr, " mode is required : -uhs | -ugcs | -ulas | -ugps | -uhs2022\n\n"); 157 162 158 163 fprintf (stderr, " optional flags:\n"); -
trunk/Ohana/src/addstar/src/args_loadwise.c
r42146 r42389 50 50 if ((N = get_argument (*argc, argv, "-v"))) { 51 51 VERBOSE = TRUE; 52 remove_argument (N, argc, argv); 53 } 54 55 /* accept proper-motion data from reference */ 56 ACCEPT_MOTION = FALSE; 57 if ((N = get_argument (*argc, argv, "-accept-motion"))) { 58 ACCEPT_MOTION = TRUE; 59 remove_argument (N, argc, argv); 60 } 61 62 /* accept proper-motion data from reference */ 63 RA_SYS_OFFRAW = 0.0; 64 DE_SYS_OFFSET = 0.0; 65 uRA_SYS_OFFSET = 0.0; 66 uDE_SYS_OFFSET = 0.0; 67 if ((N = get_argument (*argc, argv, "-sys-astrom-offsets"))) { 68 if (*argc < N + 5) { 69 fprintf (stderr, "missing args for -sys-astrom-offsets (RA) (DEC) (uRA) (uDEC)\n"); 70 exit (2); 71 } 72 remove_argument (N, argc, argv); 73 RA_SYS_OFFRAW = atof(argv[N]); 74 remove_argument (N, argc, argv); 75 DE_SYS_OFFSET = atof(argv[N]); 76 remove_argument (N, argc, argv); 77 uRA_SYS_OFFSET = atof(argv[N]); 78 remove_argument (N, argc, argv); 79 uDE_SYS_OFFSET = atof(argv[N]); 52 80 remove_argument (N, argc, argv); 53 81 } -
trunk/Ohana/src/addstar/src/fakeimage.c
r40291 r42389 7 7 double Rmin, Rmax, Dmin, Dmax; 8 8 double dX, dY, r, d; 9 char chipname[ 80], chipdata[256], name[80];9 char chipname[16], chipdata[256], name[117]; 10 10 char *config; 11 11 Image *image; … … 67 67 for (i = 0; i < Nchips; i++) { 68 68 /* this is the addstar name for the chip in the camera */ 69 s printf (chipname, "CHIP.%03d", i);69 snprintf (chipname, 16, "CHIP.%03d", i); 70 70 ScanConfig (config, chipname, "%s", 0, chipdata); 71 71 … … 74 74 75 75 /* this is the camera-specific name of a chip */ 76 s printf (name, "%s.%s", rootname, chipname);76 snprintf (name, 117, "%s.%s", rootname, chipname); 77 77 strcpy (image[i+1].name, name); 78 78 -
trunk/Ohana/src/addstar/src/find_matches_refstars.c
r39311 r42389 224 224 tgtcat[0].average[n].P = srccat->average[N].P; 225 225 tgtcat[0].average[n].dP = srccat->average[N].dP; 226 tgtcat[0].average[n].Tmean = srccat->average[N].Tmean; 226 227 } 227 228 … … 305 306 tgtcat[0].average[Nave].P = srccat->average[i].P; 306 307 tgtcat[0].average[Nave].dP = srccat->average[i].dP; 308 tgtcat[0].average[Nave].Tmean = srccat->average[i].Tmean; 307 309 } 308 310 -
trunk/Ohana/src/addstar/src/getusno.c
r38986 r42389 10 10 float hours[100]; 11 11 int start[100], number[100], *buffer, *buf; 12 char filename[ 128];12 char filename[300]; 13 13 FILE *f; 14 14 int iRA0, iRA1, iDEC0, iDEC1; -
trunk/Ohana/src/addstar/src/getusnob.c
r38986 r42389 9 9 float hours[100]; 10 10 int start[100], number[100], *buffer, *buf; 11 char filename[ 128];11 char filename[300]; 12 12 FILE *f; 13 13 double dec; -
trunk/Ohana/src/addstar/src/loadatlas_readstars.c
r41563 r42389 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 } -
trunk/Ohana/src/addstar/src/loadgaia_dr2_readstars.c
r40543 r42389 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 } -
trunk/Ohana/src/addstar/src/loadgaia_edr3_readstars.c
r41801 r42389 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 } -
trunk/Ohana/src/addstar/src/loadsupercos_ops.c
r38986 r42389 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); -
trunk/Ohana/src/addstar/src/loadsupercos_plates.c
r40291 r42389 77 77 image[Nimage].dMcal = 0.0; 78 78 79 char photname[ 128];80 snprintf (photname, 128, "SCOS.%s.%s", emulsion, filterID);79 char photname[300]; 80 snprintf (photname, 300, "SCOS.%s.%s", emulsion, filterID); 81 81 image[Nimage].photcode = GetPhotcodeCodebyName (photname); 82 82 if (!image[Nimage].photcode) { -
trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars.c
r42077 r42389 22 22 case UKIRT_MODE_ULAS: { 23 23 UKIRT_Stars *stars = loadukirt_uhs_readstars_ulas (f, buffer, nstart, options, nstars); 24 return stars; 25 } 26 27 case UKIRT_MODE_UHS2022: { 28 UKIRT_Stars *stars = loadukirt_uhs_readstars_uhs2022 (f, buffer, nstart, options, nstars); 24 29 return stars; 25 30 } -
trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugcs.c
r42131 r42389 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 } -
trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ugps.c
r42131 r42389 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 } -
trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_uhs.c
r42131 r42389 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 } -
trunk/Ohana/src/addstar/src/loadukirt_uhs_readstars_ulas.c
r42131 r42389 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 } -
trunk/Ohana/src/addstar/src/loadwise_ops.c
r42146 r42389 19 19 if (MODE == MODE_CATWISE) { 20 20 // copy the string ranges and then use strtod (not necessary?) 21 *R = strtod (&ptr[47], NULL); // safe to use the strtod on the line because it is white-space separated 22 *D = strtod (&ptr[59], NULL); 21 // *R = strtod (&ptr[47], NULL); // safe to use strtod on the line because it is white-space separated 22 // *D = strtod (&ptr[59], NULL); 23 // note we use ra_pm and dec_pm which are different from ra,dec when the object is moving 24 *R = strtod (&ptr[1139], NULL); // safe to use strtod on the line because it is white-space separated 25 *D = strtod (&ptr[1151], NULL); 23 26 } else { 24 27 ptr = skipNbounds (ptr, '|', 1, Nmax); -
trunk/Ohana/src/addstar/src/loadwise_rawdata.c
r42146 r42389 42 42 while ((Nbyte = fread (&buffer[Nextra], 1, NBYTE-Nextra, f)) != 0) { 43 43 if (Nbyte == -1) Shutdown ("error reading from raw file %s", filename); 44 if (DEBUG) fprintf (stderr, "read %d bytes ", Nbyte);44 if (DEBUG) fprintf (stderr, "read %d bytes .. n", Nbyte); 45 45 46 46 Nbyte += Nextra; … … 69 69 70 70 if (skipHeader && (MODE == MODE_CATWISE)) { 71 if (*p == '\\') goto skip_header;71 if (*p == 0x5C) goto skip_header; // back-slash char 72 72 if (*p == '|') goto skip_header; 73 } 74 if (skipHeader && (MODE == MODE_CATWISE)) { 75 // once we get past the header, do not skip any more 76 skipHeader = FALSE; 77 } 78 73 skipHeader = FALSE; // once we get past the header, do not skip any more 74 } 75 76 // note CATWISE uses a different mapping 79 77 getWISE_coords (p, &tstars[Ntstars].R, &tstars[Ntstars].D, Nbyte - offset); 78 80 79 tstars[Ntstars].offset = offset; // offset within scan 81 80 tstars[Ntstars].flag = FALSE; … … 94 93 95 94 /* start of the next line */ 96 p = q + 1; 95 p = q + 1; // q is always RETURN char on this line 97 96 offset = p - buffer; // offset within this scan 98 97 if (offset == Nbyte) { … … 104 103 q = memchr (p, '\n', Nbyte - offset); 105 104 if (q == NULL) { 106 // last, incomplete line in buffer105 // we are on the last, incomplete line in buffer 107 106 Nextra = Nbyte - offset; 108 107 break; … … 183 182 break; 184 183 case MODE_CATWISE: 185 loadwise_star_catwise (&newcat-> measure[Nmeas], &buffer[offset], Nbyte - offset, tstars[j].R, tstars[j].D);184 loadwise_star_catwise (&newcat->average[Nave], &newcat->measure[Nmeas], &buffer[offset], Nbyte - offset, &tstars[j]); 186 185 break; 187 186 default: 188 187 break; 189 188 } 189 190 if (DEBUG && (Nave < 10)) { 191 fprintf (stderr, "pos: %12.6f %12.6f +/- %10.5f %10.5f : %12.6f %12.6f +/- %10.5f %10.5f\n", 192 newcat->average[Nave].R, newcat->average[Nave].D, 193 newcat->average[Nave].dR, newcat->average[Nave].dD, 194 newcat->average[Nave].uR, newcat->average[Nave].uD, 195 newcat->average[Nave].duR, newcat->average[Nave].duD); 196 } 197 190 198 191 199 tstars[j].flag = TRUE; -
trunk/Ohana/src/addstar/src/loadwise_star_full.c
r42149 r42389 8 8 int setWISE_blend_flag (Measure *measure, char *ptr); 9 9 10 int setCatWISE_ab_flag (Measure *measure, char qual); 11 12 # define CATWISE_EPOCH 1432771200 /* MJD 57170 */ 13 10 14 // fill in the data for a CatWISE double star. takes a pointer to the start of the line the 11 15 // RA and DEC have already been set 12 int loadwise_star_catwise ( Measure *measure, char *line, int Nmax, double Rs, double Ds) {16 int loadwise_star_catwise (Average *average, Measure *measure, char *line, int Nmax, WISE_Stars *tstars) { 13 17 14 18 if (line == NULL) Shutdown ("format error in WISE"); … … 22 26 // already been extracted. 23 27 24 measure[0].R = Rs; 25 measure[0].D = Ds; 26 measure[1].R = Rs; 27 measure[1].D = Ds; 28 // reference epoch for CATWise: 29 average[0].Tmean = CATWISE_EPOCH; 30 31 // correct the position information for the systematic corrections 32 double RA_SYS_OFFSET = RA_SYS_OFFRAW / cos(RAD_DEG*tstars->D); 33 34 average[0].R = tstars->R + RA_SYS_OFFSET; 35 average[0].D = tstars->D + DE_SYS_OFFSET; 36 average[0].dR = getDoubleNAN (line, 71, 79); // sig_ra -- add 5/1000 to avoid truncation 37 average[0].dD = getDoubleNAN (line, 80, 88); // sig_dec 38 39 // P.M. values go on average: 40 average[0].uR = getDoubleNAN (line, 1194, 1203) + uRA_SYS_OFFSET; // PMRA 41 average[0].uD = getDoubleNAN (line, 1204, 1213) + uDE_SYS_OFFSET; // PMDec 42 average[0].duR = getDoubleNAN (line, 1214, 1222); // sigPMRA 43 average[0].duD = getDoubleNAN (line, 1223, 1231); // sigPMDec 44 45 measure[0].R = average[0].R; 46 measure[0].D = average[0].D; 47 measure[1].R = average[0].R; 48 measure[1].D = average[0].D; 28 49 29 50 // I can assign dRA and dDEC to dX and dY if I can consistently set posangle and pltscale 30 measure[0].dXccd = ToShortPixels( getDoubleRAW (line, 71, 79)+ 0.005); // sig_ra -- add 5/1000 to avoid truncation31 measure[0].dYccd = ToShortPixels( getDoubleRAW (line, 80, 88)+ 0.005); // sig_dec51 measure[0].dXccd = ToShortPixels(average[0].dR + 0.005); // sig_ra -- add 5/1000 to avoid truncation 52 measure[0].dYccd = ToShortPixels(average[0].dD + 0.005); // sig_dec 32 53 measure[0].posangle = 0.0; 33 54 measure[0].pltscale = 1.0; … … 39 60 measure[1].pltscale = measure[0].pltscale; 40 61 41 measure[0].Xccd = getDouble RAW(line, 98, 106); // wx42 measure[0].Yccd = getDouble RAW(line, 107, 115); // wy62 measure[0].Xccd = getDoubleNAN (line, 98, 106); // wx 63 measure[0].Yccd = getDoubleNAN (line, 107, 115); // wy 43 64 measure[1].Xccd = measure[0].Xccd; 44 65 measure[1].Yccd = measure[0].Yccd; … … 47 68 measure[0].M = getDoubleNAN (line, 248, 254); // w1mpro 48 69 measure[0].dM = getDoubleNAN (line, 255, 264); // w1sigmpro 49 measure[0].psfChisq = getDoubleRAW (line, 265, 275); // w1rchi2 50 measure[0].psfQF = measure[0].psfChisq; 70 measure[0].psfChisq = getDoubleNAN (line, 265, 275); // w1rchi2 51 71 measure[0].photFlags = 0; 72 73 measure[0].Mkron = getDoubleNAN (line, 563, 572); // w1mag_4 74 measure[0].dMkron = getDoubleNAN (line, 573, 582); // w1sigm_4 75 measure[0].Map = getDoubleNAN (line, 339, 345); // w1mag 76 measure[0].dMap = getDoubleNAN (line, 346, 352); // w1sigm 77 78 measure[0].Xfix = getDoubleNAN (line, 880, 891); // w1k 79 measure[0].Yfix = getDoubleNAN (line, 989, 903); // w1mLQ 52 80 53 81 // W2 54 82 measure[1].M = getDoubleNAN (line, 276, 282); // w2mpro 55 83 measure[1].dM = getDoubleNAN (line, 283, 292); // w2sigmpro 56 measure[1].psfChisq = getDoubleRAW (line, 293, 303); // w2rchi2 57 measure[1].psfQF = measure[1].psfChisq; 84 measure[1].psfChisq = getDoubleNAN (line, 293, 303); // w2rchi2 58 85 measure[1].photFlags = 0; 59 86 60 setCatWISE_blend_flag (measure, line); // w1sat 87 measure[1].Mkron = getDoubleNAN (line, 591, 600); // w2mag_4 88 measure[1].dMkron = getDoubleNAN (line, 601, 610); // w2sigm_4 89 measure[1].Map = getDoubleNAN (line, 367, 373); // w2mag 90 measure[1].dMap = getDoubleNAN (line, 374, 380); // w2sigm 91 92 measure[1].Xfix = getDoubleNAN (line, 995, 1006); // w2k 93 measure[1].Yfix = getDoubleNAN (line, 1013, 1018); // w2mLQ 94 95 measure[0].psfQF = getDoubleNAN (line, 304, 314); // rchi2 96 measure[1].psfQF = measure[0].psfQF; 97 98 setCatWISE_blend_flag (measure, line); // na & nb 61 99 62 100 setCatWISE_sat_flag (&measure[0], line, 323, 330); // w1sat 63 101 setCatWISE_sat_flag (&measure[1], line, 331, 338); // w2sat 64 102 65 // cc_flags? 1642 - 1657 66 // setWISE_cc_flag (&measure[0], ptr[i]); // cc_flags 67 68 // set ext flags for all 4 measures 69 // setCatWISE_ext_flag_allsky (measure, ptr[0]); // ext_flg 70 71 // setWISE_var_flag_allsky (&measure[0], ptr[i]); // var_flg 72 73 // setWISE_ph_qual (&measure[i], ptr[i]); // ph_qual 74 75 double mjdmean = getDoubleRAW (line, 1126, 1138); // MeanObsMJD 103 // cc_flags is a field which takes 15 chars, but only 4 are used 104 // bytes 1653 - 1656 are the allWise cc_flag entries for W1, W2, W3, W4 105 // skip lines for which the 4 chars have the value 'null' 106 if (strncmp(&line[1653], "null", 4)) { 107 setWISE_cc_flag (&measure[0], line[1653]); // W1 cc_flag 108 setWISE_cc_flag (&measure[1], line[1654]); // W2 cc_flag 109 } 110 111 // cc_flags is a field which takes 8 chars, but only 2 are used 112 // bytes 1735 & 1736 are the ab_flag entries for W1 & W2 113 // they use the same values as cc_flags 114 setCatWISE_ab_flag (&measure[0], line[1735]); // W1 ab_flag 115 setCatWISE_ab_flag (&measure[1], line[1736]); // W2 ab_flag 116 117 double mjdmean = getDoubleNAN (line, 1126, 1138); // MeanObsMJD 76 118 77 119 // the release is based on data taken in the period 14 January 2010 to 29 April 2010 … … 575 617 } 576 618 return TRUE; 619 } 620 621 int setCatWISE_ab_flag (Measure *measure, char qual) { 622 623 switch (qual) { 624 case 'P': measure[0].photFlags2 |= FLAG_CC_PERSIST | FLAG_CC_SPURIOUS; break; 625 case 'H': measure[0].photFlags2 |= FLAG_CC_HALO | FLAG_CC_SPURIOUS; break; 626 case 'D': measure[0].photFlags2 |= FLAG_CC_SPIKE | FLAG_CC_SPURIOUS; break; 627 case 'O': measure[0].photFlags2 |= FLAG_CC_GHOST | FLAG_CC_SPURIOUS; break; 628 629 case '0': break; 630 default: 631 fprintf (stderr, "error in ab_flag: %c\n", qual); 632 } 633 return (TRUE); 577 634 } 578 635 -
trunk/Ohana/src/addstar/src/mkcmf.c
r40291 r42389 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 } -
trunk/Ohana/src/addstar/src/sky_tessalation.c
r40528 r42389 52 52 Ntotal = Nbase*pow(4.0, level); 53 53 Ndigit = (int)(log10(Ntotal)) + 1 ; 54 snprintf (format, 16, "skytri.%%0%dd", Ndigit);54 snprintf_nowarn (format, 16, "skytri.%%0%dd", Ndigit); 55 55 56 56 // to what depth do we need to go to have only Nmax foreach subcell? … … 90 90 for (j = 0; j < Ntriangles; j++) { 91 91 sky_triangle_to_image (&image[j], &tri[j]); 92 snprintf (image[j].name, DVO_IMAGE_NAME_LEN, format, Nout);92 snprintf_nowarn (image[j].name, DVO_IMAGE_NAME_LEN, format, Nout); 93 93 Nout++; 94 94 } … … 128 128 Ntotal = Nbase*pow(4.0, level); 129 129 Ndigit = (int)(log10(Ntotal)) + 1 ; 130 snprintf (format, 16, "skycell.%%0%dd", Ndigit);130 snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit); 131 131 132 132 // to what depth do we need to go to have only Nmax foreach subcell? … … 173 173 if (!strcmp(rectangle[j].coords.ctype, "DROP")) continue; 174 174 memcpy (&subset[Nsubset], &rectangle[j], sizeof(SkyRectangle)); 175 snprintf (subset[Nsubset].name, DVO_IMAGE_NAME_LEN, format, Nname);175 snprintf_nowarn (subset[Nsubset].name, DVO_IMAGE_NAME_LEN, format, Nname); 176 176 Nname++; 177 177 Nsubset++; … … 254 254 for (double dec = -90.0; dec < +90.01; dec += CELLSIZE, Ndec ++) { 255 255 256 snprintf (format, 32, "skycell.%%03d.%03d", Ndec);256 snprintf_nowarn (format, 32, "skycell.%%03d.%03d", Ndec); 257 257 258 258 int Nring; … … 310 310 Ntotal = 41254.2 / (dDEC*dDEC); 311 311 Ndigit = (int)(log10(Ntotal)) + 1 ; 312 snprintf (format, 16, "skycell.%%0%dd", Ndigit);312 snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit); 313 313 314 314 // generate the a collection of rectangles for each ring … … 367 367 Ntotal = 41254.2 / (dDEC*dDEC); 368 368 Ndigit = (int)(log10(Ntotal)) + 1 ; 369 snprintf (format, 16, "skycell.%%0%dd", Ndigit);369 snprintf_nowarn (format, 16, "skycell.%%0%dd", Ndigit); 370 370 371 371 double d2r = M_PI / 180; // is RAD_DEG … … 716 716 // CFIS uses names with centers based on ra,dec 717 717 // format = skycell.%03d.%03d 718 snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, i);718 snprintf_nowarn (ring[i].name, DVO_IMAGE_NAME_LEN, format, i); 719 719 } 720 720 … … 826 826 ring[i].photcode = 1; // this needs to be set more sensibly 827 827 828 snprintf (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname);828 snprintf_nowarn (ring[i].name, DVO_IMAGE_NAME_LEN, format, Nname); 829 829 Nname++; 830 830 … … 897 897 ring[N].photcode = 1; // this needs to be set more sensibly 898 898 899 snprintf (ring[N].name, DVO_IMAGE_NAME_LEN, format, Nname);899 snprintf_nowarn (ring[N].name, DVO_IMAGE_NAME_LEN, format, Nname); 900 900 Nname++; 901 901 } … … 927 927 if (Nx * Ny > 1) { 928 928 Ndigit = (int)(log10(Nx*Ny)) + 1 ; 929 snprintf (format, 80, "%s.%%0%dd", input[0].name, Ndigit);929 snprintf_nowarn (format, 80, "%s.%%0%dd", input[0].name, Ndigit); 930 930 } else { 931 snprintf (format, 80, "%s", input[0].name);931 snprintf_nowarn (format, 80, "%s", input[0].name); 932 932 } 933 933 … … 944 944 945 945 if (Nx + Ny > 1) { 946 snprintf (output[N].name, DVO_IMAGE_NAME_LEN, format, N);946 snprintf_nowarn (output[N].name, DVO_IMAGE_NAME_LEN, format, N); 947 947 } else { 948 snprintf (output[N].name, DVO_IMAGE_NAME_LEN, "%s", format);948 snprintf_nowarn (output[N].name, DVO_IMAGE_NAME_LEN, "%s", format); 949 949 } 950 950 -
trunk/Ohana/src/delstar/src/delete_duplicate_images.c
r39457 r42389 108 108 // set up the basic catalog info 109 109 char hostfile[1024]; 110 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);110 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 111 111 112 112 dvo_catalog_init (&catalog, TRUE); … … 148 148 // write out the subset table of image information 149 149 char imageFile[512]; 150 snprintf (imageFile, 512, "%s/ImageIDs.tmp.fits", CATDIR);150 snprintf_nowarn (imageFile, 512, "%s/ImageIDs.tmp.fits", CATDIR); 151 151 152 152 if (!ImageIDSave (imageFile, imageID)) { … … 173 173 174 174 char command[1024]; 175 snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -dup-images",175 snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -dup-images", 176 176 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 177 177 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 178 178 179 179 char tmpline[1024]; 180 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }181 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }180 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 181 if (VERBOSE2) { snprintf_nowarn (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 182 182 183 183 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/delstar/src/delete_fix_LAP.c
r40549 r42389 40 40 // set up the basic catalog info 41 41 char hostfile[1024]; 42 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);42 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 43 43 44 44 dvo_catalog_init (&catalog, TRUE); … … 92 92 // write out the subset table of image information 93 93 char imageFile[512]; 94 snprintf (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, uniquer);94 snprintf_nowarn (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, uniquer); 95 95 96 96 if (!ImageSubsetSave (imageFile, image, Nimage)) { … … 132 132 133 133 ALLOCATE (table->hosts[i].results, char, 1024); 134 snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, uniquer);134 snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, uniquer); 135 135 136 136 char command[1024]; 137 snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -images %s -imstats %s -region %f %f %f %f -fix-LAP",137 snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -images %s -imstats %s -region %f %f %f %f -fix-LAP", 138 138 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, imageFile, table->hosts[i].results, 139 139 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 140 140 141 141 char tmpline[1024]; 142 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }143 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }144 if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }145 if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); }142 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 143 if (VERBOSE2) { snprintf_nowarn (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 144 if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 145 if (UPDATE) { snprintf_nowarn (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 146 146 147 147 fprintf (stderr, "command: %s\n", command); … … 210 210 // write out the subset table of image information 211 211 char imageFile[512]; 212 snprintf (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, UNIQUER);212 snprintf_nowarn (imageFile, 512, "%s/delstar.fixLAP.%s.dat", CATDIR, UNIQUER); 213 213 214 214 // load the list of hosts … … 228 228 229 229 ALLOCATE (table->hosts[i].results, char, 1024); 230 snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, UNIQUER);230 snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAP.imstats.%s.dat", table->hosts[i].pathname, UNIQUER); 231 231 232 232 fprintf (stderr, "read %s\n", table->hosts[i].results); -
trunk/Ohana/src/delstar/src/delete_fix_LAP_edges.c
r40549 r42389 48 48 // set up the basic catalog info 49 49 char hostfile[1024]; 50 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);50 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 51 51 52 52 dvo_catalog_init (&catalog, TRUE); … … 122 122 123 123 ALLOCATE (table->hosts[i].results, char, 1024); 124 snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);124 snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer); 125 125 126 126 char command[1024]; 127 snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -measures %s -region %f %f %f %f -fix-LAP-edges",127 snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -measures %s -region %f %f %f %f -fix-LAP-edges", 128 128 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, table->hosts[i].results, 129 129 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 130 130 131 131 char tmpline[1024]; 132 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }133 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }134 if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }135 // if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); }132 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 133 if (VERBOSE2) { snprintf_nowarn (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 134 if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 135 // if (UPDATE) { snprintf_nowarn (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 136 136 137 137 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/delstar/src/delete_fix_LAP_edges_delete.c
r40549 r42389 88 88 // set up the basic catalog info 89 89 char hostfile[1024]; 90 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);90 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 91 91 92 92 dvo_catalog_init (&catalog, TRUE); … … 180 180 181 181 // ALLOCATE (table->hosts[i].results, char, 1024); 182 // snprintf (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer);182 // snprintf_nowarn (table->hosts[i].results, 1024, "%s/delstar.fixLAPedges.measures.%s.dat", table->hosts[i].pathname, uniquer); 183 183 184 184 char command[1024]; 185 snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -fix-LAP-edges-delete %s",185 snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -fix-LAP-edges-delete %s", 186 186 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 187 187 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, … … 189 189 190 190 char tmpline[1024]; 191 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }192 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }193 if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }194 if (UPDATE) { snprintf (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); }191 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 192 if (VERBOSE2) { snprintf_nowarn (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 193 if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 194 if (UPDATE) { snprintf_nowarn (tmpline, 1024, "%s -update", command); strcpy (command, tmpline); } 195 195 196 196 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/delstar/src/delete_photcodes.c
r38986 r42389 38 38 // set up the basic catalog info 39 39 char hostfile[1024]; 40 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);40 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 41 41 42 42 dvo_catalog_init (&catalog, TRUE); … … 94 94 95 95 char command[1024]; 96 snprintf (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -photcodes %s",96 snprintf_nowarn (command, 1024, "delstar_client -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -photcodes %s", 97 97 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 98 98 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, … … 100 100 101 101 char tmpline[1024]; 102 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }103 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); }102 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 103 if (VERBOSE2) { snprintf_nowarn (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 104 104 105 105 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/dvomerge/src/dvorepairFixStackIDs.c
r39336 r42389 33 33 34 34 while (fscanf (f, "%s", catdir) != EOF) { 35 snprintf (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);36 snprintf (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);35 snprintf_nowarn (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir); 36 snprintf_nowarn (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir); 37 37 38 38 if ((image = LoadImages (&db, imageFilenameOld, &Nimage)) == NULL) { -
trunk/Ohana/src/dvomerge/src/dvorepairFixWarpIDs.c
r39329 r42389 46 46 47 47 while (fscanf (f, "%s", catdir) != EOF) { 48 snprintf (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir);49 snprintf (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir);48 snprintf_nowarn (imageFilenameOld, DVO_MAX_PATH, "%s/Images.dat", catdir); 49 snprintf_nowarn (imageFilenameNew, DVO_MAX_PATH, "%s/Images.dat.fixed", catdir); 50 50 51 51 if ((image = LoadImages (&db, imageFilenameOld, &Nimage)) == NULL) { -
trunk/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c
r40378 r42389 34 34 35 35 char hostfile[1024]; 36 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);36 snprintf_nowarn (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name); 37 37 38 38 dvo_catalog_init (&catalog, TRUE); … … 116 116 // options / arguments that can affect relastro_client -update-objects: 117 117 char command[DVO_MAX_PATH]; 118 snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f",118 snprintf_nowarn (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f", 119 119 abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname, 120 120 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax … … 122 122 123 123 char tmpline[DVO_MAX_PATH]; 124 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }125 if (SINGLE_CPT) { snprintf (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }124 if (VERBOSE) { snprintf_nowarn (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); } 125 if (SINGLE_CPT) { snprintf_nowarn (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 126 126 127 127 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/dvopsps/src/insert_FGshape_dvopsps.c
r39564 r42389 47 47 48 48 char localFilename[1024]; 49 snprintf (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);49 snprintf_nowarn (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name); 50 50 51 51 // set up the basic catalog info … … 125 125 126 126 char command[1024]; 127 snprintf (command, 1024, "dvopsps_client forced_galaxy_shape -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",127 snprintf_nowarn (command, 1024, "dvopsps_client forced_galaxy_shape -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 128 128 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 129 129 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 130 130 131 131 char tmpline[1024]; 132 snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);133 snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);134 snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);135 snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);132 snprintf_nowarn (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline); 133 snprintf_nowarn (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline); 134 snprintf_nowarn (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline); 135 snprintf_nowarn (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline); 136 136 137 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }138 if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }137 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 138 if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 139 139 140 140 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/dvopsps/src/insert_FWobjects_dvopsps.c
r40291 r42389 47 47 48 48 char localFilename[1024]; 49 snprintf (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name);49 snprintf_nowarn (localFilename, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name); 50 50 51 51 // set up the basic catalog info … … 126 126 127 127 char command[1024]; 128 snprintf (command, 1024, "dvopsps_client forced_warp_objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f",128 snprintf_nowarn (command, 1024, "dvopsps_client forced_warp_objects -hostID %d -catdir %s -hostdir %s -region %f %f %f %f", 129 129 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, 130 130 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 131 131 132 132 char tmpline[1024]; 133 snprintf (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline);134 snprintf (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline);135 snprintf (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline);136 snprintf (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline);133 snprintf_nowarn (tmpline, 1024, "%s -dbhost %s", command, DATABASE_HOST); strcpy (command, tmpline); 134 snprintf_nowarn (tmpline, 1024, "%s -dbuser %s", command, DATABASE_USER); strcpy (command, tmpline); 135 snprintf_nowarn (tmpline, 1024, "%s -dbpass %s", command, DATABASE_PASS); strcpy (command, tmpline); 136 snprintf_nowarn (tmpline, 1024, "%s -dbname %s", command, DATABASE_NAME); strcpy (command, tmpline); 137 137 138 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); }139 if (TEST_MODE) { snprintf (tmpline, 1024, "%s -test-mode", command); strcpy (command, tmpline); }140 if (SINGLE_CPT) { snprintf (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); }138 if (VERBOSE) { snprintf_nowarn (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 139 if (TEST_MODE) { snprintf_nowarn (tmpline, 1024, "%s -test-mode", command); strcpy (command, tmpline); } 140 if (SINGLE_CPT) { snprintf_nowarn (tmpline, 1024, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 141 141 142 142 fprintf (stderr, "command: %s\n", command); -
trunk/Ohana/src/elixir/src/ConfigInit.c
r16139 r42389 98 98 if (config == (char *) NULL) { 99 99 fprintf (stderr, "ERROR: can't find configuration file %s\n", file); 100 if (file != (char *) NULL) free (file); 100 // XXX note: the test below fools gcc into thinking file could be NUL 101 // even though the test above forces an exit if it is NULL. 102 // if (file != (char *) NULL) free (file); 101 103 Shutdown (1); 104 exit (2); 102 105 } 103 106 if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file); -
trunk/Ohana/src/elixir/src/Photcodes.c
r10336 r42389 72 72 char name[256], path[256], ccd[80], mode[80]; 73 73 int i; 74 75 p = line; 76 while ((p = strchr (p, ',')) != (char *) NULL) { *p = ' '; } 77 sscanf (line, "%s %s %s %s", path, name, ccd, mode); 78 79 if (!strcasecmp (mode, "MEF")) { 80 snprintf_nowarn (fullname, 256, "%s/%s.fits", path, name); 81 } else { 82 snprintf_nowarn (fullname, 256, "%s/%s/%s%s.fits", path, name, name, ccd); 83 } 84 85 if (!gfits_read_header (fullname, &header)) { 86 fprintf (stderr, "ERROR: can't find image file %s (1)\n", fullname); 87 exit(0); 88 } 89 gfits_scan (&header, "DETECTOR", "%s", 1, detector); 90 gfits_scan (&header, "FILTER", "%s", 1, filter); 91 gfits_free_header (&header); 92 93 for (i = 0; i < strlen(detector); i++) { detector[i] = toupper (detector[i]); } 94 for (i = 0; i < strlen(filter); i++) { filter[i] = toupper (filter[i]); } 95 96 ALLOCATE (code, char, 256); 97 sprintf (code, "%s.%s.%s", detector, filter, ccd); 98 return (code); 99 100 } 101 102 char *BuildName (char *line) { 103 104 char *fullname; 105 char name[256], path[256], ccd[80], mode[80]; 106 char *p; 107 108 ALLOCATE (fullname, char, 256); 74 109 75 110 p = line; … … 83 118 } 84 119 85 if (!gfits_read_header (fullname, &header)) {86 fprintf (stderr, "ERROR: can't find image file %s (1)\n", fullname);87 exit(0);88 }89 gfits_scan (&header, "DETECTOR", "%s", 1, detector);90 gfits_scan (&header, "FILTER", "%s", 1, filter);91 gfits_free_header (&header);92 93 for (i = 0; i < strlen(detector); i++) { detector[i] = toupper (detector[i]); }94 for (i = 0; i < strlen(filter); i++) { filter[i] = toupper (filter[i]); }95 96 ALLOCATE (code, char, 256);97 sprintf (code, "%s.%s.%s", detector, filter, ccd);98 return (code);99 100 }101 102 char *BuildName (char *line) {103 104 char *fullname;105 char name[256], path[256], ccd[80], mode[80];106 char *p;107 108 ALLOCATE (fullname, char, 256);109 110 p = line;111 while ((p = strchr (p, ',')) != (char *) NULL) { *p = ' '; }112 sscanf (line, "%s %s %s %s", path, name, ccd, mode);113 114 if (!strcasecmp (mode, "MEF")) {115 sprintf (fullname, "%s/%s.fits", path, name);116 } else {117 sprintf (fullname, "%s/%s/%s%s.fits", path, name, name, ccd);118 }119 120 120 return (fullname); 121 121 … … 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); -
trunk/Ohana/src/elixir/src/ProcessOps.c
r27435 r42389 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 -
trunk/Ohana/src/fakeastro/src/AstromOffsetMapOps.c
r37807 r42389 6 6 7 7 char mapfile[DVO_MAX_PATH]; 8 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);8 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 9 9 AstromOffsetMapSave (table, mapfile); 10 10 -
trunk/Ohana/src/fakeastro/src/ConfigInit.c
r39926 r42389 4 4 5 5 char *config, *file; 6 char CatdirPhotcodeFile[ 256];6 char CatdirPhotcodeFile[DVO_MAX_PATH]; 7 7 8 8 /*** load configuration info ***/ … … 90 90 91 91 /* update master photcode table if not defined */ 92 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR_CHECK);92 snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR_CHECK); 93 93 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) { 94 94 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); -
trunk/Ohana/src/fakeastro/src/save_fakestars.c
r40549 r42389 18 18 // save to a unique filename 19 19 char filename[1024]; // CATDIR/tmpdir/starpar.PID.index.fits 20 snprintf (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index);20 snprintf_nowarn (filename, 1024, "%s/tmpdir/starpar.%s.%05d.fits", CATDIR, uniquer, region->index); 21 21 22 22 // write the data to the given FITS file -
trunk/Ohana/src/fixcat/src/aregion.c
r27435 r42389 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; -
trunk/Ohana/src/gastro/src/getusno.c
r27611 r42389 9 9 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10}; 10 10 11 # define MY_MAX_PATH 256 12 11 13 USNOdata *getusno (USNOstats *usnostats, CatStats *catstats, int *Nusno) { 12 14 … … 15 17 float hours[100]; 16 18 int start[100], number[100], *buffer, *buf; 17 char filename[ 128], c;19 char filename[MY_MAX_PATH], c; 18 20 FILE *f; 19 21 double DEC1; … … 52 54 53 55 /* load accelerator file */ 54 s printf (filename, "%s/zone%04d.acc", CDROM, spd);56 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", CDROM, spd); 55 57 fprintf (stderr, "reading from %s\n", filename); 56 58 f = fopen (filename, "r"); … … 82 84 83 85 /* open data file */ 84 s printf (filename, "%s/zone%04d.cat", CDROM, spd);86 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", CDROM, spd); 85 87 fprintf (stderr, "reading from %s\n", filename); 86 88 f = fopen (filename, "r"); -
trunk/Ohana/src/gastro2/src/getusno.c
r27435 r42389 9 9 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10}; 10 10 11 # define MY_MAX_PATH 256 12 11 13 int getusno (CatStats *catstats, RefCatalog *Ref) { 12 14 … … 15 17 float hours[100]; 16 18 int start[100], number[100], *buffer, *buf; 17 char filename[ 128];19 char filename[MY_MAX_PATH]; 18 20 FILE *f; 19 21 double DEC1; … … 54 56 55 57 /* load accelerator file */ 56 s printf (filename, "%s/zone%04d.acc", USNO_A_DIR, spd);58 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", USNO_A_DIR, spd); 57 59 fprintf (stderr, "reading from %s\n", filename); 58 60 f = fopen (filename, "r"); … … 77 79 78 80 /* open data file */ 79 s printf (filename, "%s/zone%04d.cat", USNO_A_DIR, spd);81 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", USNO_A_DIR, spd); 80 82 fprintf (stderr, "reading from %s\n", filename); 81 83 f = fopen (filename, "r"); -
trunk/Ohana/src/gastro2/src/getusnob.c
r34088 r42389 2 2 # define NBYTE 4 3 3 # define NELEM 20 4 5 # define MY_MAX_PATH 256 4 6 5 7 int getusnob (CatStats *catstats, RefCatalog *Ref, double epoch) { … … 9 11 float hours[100]; 10 12 int start[100], number[100], *buffer, *buf; 11 char filename[ 128];13 char filename[MY_MAX_PATH]; 12 14 FILE *f; 13 15 double DEC1; … … 42 44 43 45 /* load accelerator file */ 44 s printf (filename, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd);46 snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 45 47 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 46 48 f = fopen (filename, "r"); … … 65 67 66 68 /* open data file */ 67 s printf (filename, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd);69 snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 68 70 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 69 71 f = fopen (filename, "r"); -
trunk/Ohana/src/getstar/src/ConfigInit.c
r34749 r42389 1 1 # include "getstar.h" 2 3 # define MY_MAX_PATH 256 2 4 3 5 int ConfigInit (int *argc, char **argv) { 4 6 5 7 char *config, *file; 6 char CatdirPhotcodeFile[ 256];8 char CatdirPhotcodeFile[MY_MAX_PATH]; 7 9 8 10 /*** load configuration info ***/ … … 31 33 32 34 /* XXX this does not yet write out the master photcode table */ 33 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);35 snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", CATDIR); 34 36 if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) { 35 37 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); -
trunk/Ohana/src/getstar/src/ConfigInit_coords.c
r39998 r42389 25 25 SKY_TABLE[0] = 0; 26 26 } 27 s printf (ImageCat, "%s/Images.dat", CATDIR);27 snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR); 28 28 29 29 /* used by parse_time to find time-related keywords */ -
trunk/Ohana/src/getstar/src/ConfigInit_extract.c
r27435 r42389 25 25 SKY_TABLE[0] = 0; 26 26 } 27 s printf (ImageCat, "%s/Images.dat", CATDIR);27 snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR); 28 28 29 29 if (*CATMODE == 0) strcpy (CATMODE, "RAW"); -
trunk/Ohana/src/getstar/src/ConfigInit_overlaps.c
r41891 r42389 25 25 SKY_TABLE[0] = 0; 26 26 } 27 s printf (ImageCat, "%s/Images.dat", CATDIR);27 snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR); 28 28 29 29 /* used by parse_time to find time-related keywords */ -
trunk/Ohana/src/imregister/base/ConfigInit.c
r25757 r42389 6 6 7 7 int i, NDB; 8 char *config, *file, ElixirBase[80], catdir[ 256];9 char CatdirPhotcodeFile[ 256];10 char MasterPhotcodeFile[ 256];8 char *config, *file, ElixirBase[80], catdir[MY_MAX_PATH]; 9 char CatdirPhotcodeFile[MY_MAX_PATH]; 10 char MasterPhotcodeFile[MY_MAX_PATH]; 11 11 12 12 /*** load configuration info ***/ … … 28 28 WarnConfig (config, "CATDIR", "%s", 0, catdir); 29 29 WarnConfig (config, "PHOTCODE_FILE", "%s", 0, MasterPhotcodeFile); 30 s printf (ImPhotDB, "%s/Images.dat", catdir);30 snprintf_nowarn (ImPhotDB, MY_MAX_PATH, "%s/Images.dat", catdir); 31 31 32 32 /* small text databases: filters, camera defs */ … … 75 75 76 76 WarnConfig (config, "imstats", "%s", 0, ElixirBase); 77 s printf (ImstatFifo, "%s.photcode", ElixirBase);77 snprintf_nowarn (ImstatFifo, MY_MAX_PATH, "%s.photcode", ElixirBase); 78 78 WarnConfig (config, "ptolemy", "%s", 0, ElixirBase); 79 s printf (PtolemyFifo, "%s.photcode", ElixirBase);79 snprintf_nowarn (PtolemyFifo, MY_MAX_PATH, "%s.photcode", ElixirBase); 80 80 81 81 if (!ScanConfig (config, "CONNECT", "%s", 0, CONNECT)) { 82 s printf (CONNECT, "/usr/bin/rsh");82 snprintf_nowarn (CONNECT, 64, "/usr/bin/rsh"); 83 83 } 84 84 … … 87 87 NDetrendAltDB = 0; 88 88 ALLOCATE (DetrendAltDB, char *, NDB); 89 ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);89 ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH); 90 90 for (i = 1; ScanConfig (config, "DETREND_ALT_DB", "%s", i, DetrendAltDB[NDetrendAltDB]); i++) { 91 91 NDetrendAltDB ++; … … 94 94 REALLOCATE (DetrendAltDB, char *, NDB); 95 95 } 96 ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);96 ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH); 97 97 } 98 98 free (DetrendAltDB[NDetrendAltDB]); … … 104 104 105 105 /* XXX this does not yet write out the master photcode table */ 106 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", catdir);106 snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", catdir); 107 107 if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) { 108 108 fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile); -
trunk/Ohana/src/imregister/base/fits_scan_nchar.c
r7080 r42389 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); -
trunk/Ohana/src/imregister/detrend/entry.c
r6674 r42389 31 31 int status; 32 32 int found, Ntry, filestate; 33 char path[256], fullpath[256], filename[256], rootname[256], fullname[256], line[512]; 33 char path[MY_MAX_PATH], fullpath[MY_MAX_PATH], filename[MY_MAX_PATH]; 34 char rootname[MY_MAX_PATH], fullname[MY_MAX_PATH], line[512]; 34 35 char *dBPath; 35 36 char *filter_basename; … … 41 42 42 43 if (newdata[0].type == T_FLAT) { 43 s printf (path, "%s/%s", get_type_name(newdata[0].type), filter_basename);44 snprintf_nowarn (path, MY_MAX_PATH, "%s/%s", get_type_name(newdata[0].type), filter_basename); 44 45 } else { 45 s printf (path, "%s", get_type_name(newdata[0].type));46 snprintf_nowarn (path, MY_MAX_PATH, "%s", get_type_name(newdata[0].type)); 46 47 } 47 s printf (fullpath, "%s/%s", dBPath, path);48 snprintf_nowarn (fullpath, MY_MAX_PATH, "%s/%s", dBPath, path); 48 49 49 50 status = stat (fullpath, &statbuf); … … 65 66 case T_BIAS: 66 67 case T_MASK: 67 s printf (rootname, "%s.%s.%d.%02d", ID, get_type_name(newdata[0].type), (int)newdata[0].exptime, newdata[0].ccd);68 snprintf_nowarn (rootname, MY_MAX_PATH, "%s.%s.%d.%02d", ID, get_type_name(newdata[0].type), (int)newdata[0].exptime, newdata[0].ccd); 68 69 break; 69 70 default: 70 s printf (rootname, "%s.%s.%s.%02d", ID, get_type_name(newdata[0].type), filter_basename, newdata[0].ccd);71 snprintf_nowarn (rootname, MY_MAX_PATH, "%s.%s.%s.%02d", ID, get_type_name(newdata[0].type), filter_basename, newdata[0].ccd); 71 72 } 72 73 … … 74 75 found = FALSE; 75 76 for (Ntry = 0; !found && (Ntry < 100); Ntry++) { 76 s printf (filename, "%s/%s.%02d.fits", path, rootname, Ntry);77 s printf (fullname, "%s/%s", dBPath, filename);77 snprintf_nowarn (filename, MY_MAX_PATH, "%s/%s.%02d.fits", path, rootname, Ntry); 78 snprintf_nowarn (fullname, MY_MAX_PATH, "%s/%s", dBPath, filename); 78 79 f = fsetlockfile (fullname, 2.0, LCK_XCLD, &filestate); 79 80 /* if there is an error, it may just mean file is locked. */ -
trunk/Ohana/src/imregister/detrend/output.c
r40501 r42389 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 -
trunk/Ohana/src/imregister/imreg/args.imregister.c
r2823 r42389 73 73 74 74 /* create db.log and db.bfr */ 75 s printf (TempDB, "%s.bfr", ImageDB);76 s printf (LogFile, "%s.log", ImageDB);75 snprintf_nowarn (TempDB, MY_MAX_PATH, "%s.bfr", ImageDB); 76 snprintf_nowarn (LogFile, MY_MAX_PATH, "%s.log", ImageDB); 77 77 78 78 /* check for daemon mode */ -
trunk/Ohana/src/imregister/imreg/iminfo.c
r27590 r42389 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 */ -
trunk/Ohana/src/imregister/imreg/modify.c
r34088 r42389 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 -
trunk/Ohana/src/imregister/include/imregister.h
r27435 r42389 11 11 */ 12 12 13 char ImstatFifo[256]; 14 char PtolemyFifo[256]; 13 # define MY_MAX_PATH 256 15 14 16 char ImageDB[256]; 17 char DetrendDB[256]; 18 char PhotDB[256]; 19 char TransDB[256]; 20 char ImPhotDB[256]; 21 char TempDB[256]; 22 char LogFile[256]; 15 char ImstatFifo[MY_MAX_PATH]; 16 char PtolemyFifo[MY_MAX_PATH]; 17 18 char ImageDB[MY_MAX_PATH]; 19 char DetrendDB[MY_MAX_PATH]; 20 char PhotDB[MY_MAX_PATH]; 21 char TransDB[MY_MAX_PATH]; 22 char ImPhotDB[MY_MAX_PATH]; 23 char TempDB[MY_MAX_PATH]; 24 char LogFile[MY_MAX_PATH]; 23 25 char CONNECT[64]; 24 26 … … 26 28 char **DetrendAltDB; 27 29 28 char PhotCodeFile[ 256];29 char TempLogFile[ 256];30 char FilterList[ 256];31 char CameraConfig[ 256];32 char RecipeFile[ 256];30 char PhotCodeFile[MY_MAX_PATH]; 31 char TempLogFile[MY_MAX_PATH]; 32 char FilterList[MY_MAX_PATH]; 33 char CameraConfig[MY_MAX_PATH]; 34 char RecipeFile[MY_MAX_PATH]; 33 35 34 36 char DateKeyword[64]; -
trunk/Ohana/src/imregister/photreg/getImageData.c
r12332 r42389 60 60 } 61 61 62 s printf (photcode, "%s.%s.%02d", detector, filter, ccd);62 snprintf_nowarn (photcode, 64, "%s.%s.%02d", detector, filter, ccd); 63 63 if (!(criteria.photcode = GetPhotcodeCodebyName (photcode))) { 64 64 fprintf (stderr, "ERR: photcode not found table\n"); -
trunk/Ohana/src/imregister/src/photcode-table.c
r12332 r42389 60 60 61 61 char *config, *file; 62 char CATDIR[ 256];62 char CATDIR[MY_MAX_PATH]; 63 63 64 64 /*** load configuration info ***/ … … 76 76 77 77 // set the CATDIR version based on CATDIR 78 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);78 snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", CATDIR); 79 79 80 80 free (config); -
trunk/Ohana/src/kapa2/src/LoadLabels.c
r41341 r42389 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); -
trunk/Ohana/src/kapa2/src/LoadTickmarks.c
r16011 r42389 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 -
trunk/Ohana/src/libdvo/include/dvodb.h
r42075 r42389 150 150 151 151 /* measure fields */ 152 enum {MEAS_ZERO,152 typedef enum {MEAS_ZERO, 153 153 MEAS_GLON, 154 154 MEAS_GLAT, … … 312 312 313 313 /* average fields */ 314 enum {AVE_ZERO,314 typedef enum {AVE_ZERO, 315 315 AVE_RA, 316 316 AVE_DEC, … … 376 376 // AVE_Xm, 377 377 378 enum {IMAGE_ZERO,378 typedef enum {IMAGE_ZERO, 379 379 IMAGE_RA, 380 380 IMAGE_DEC, -
trunk/Ohana/src/libdvo/src/coordops.c
r42075 r42389 888 888 889 889 int OldAIPS; 890 char csys[16], ctype[ 16];890 char csys[16], ctype[32]; 891 891 double rotate, Lambda; 892 892 … … 906 906 if (!strncmp (coords[0].ctype, "SLAT", 4)) strcpy (csys, "SLON"); 907 907 if (!strcmp (csys, "NONE")) return (FALSE); 908 snprintf (ctype, 16, "%s-%s", csys, &coords[0].ctype[5]);908 snprintf (ctype, 32, "%s-%s", csys, &coords[0].ctype[5]); 909 909 gfits_modify (header, "CTYPE1", "%s", 1, ctype); 910 910 } -
trunk/Ohana/src/libdvo/src/dbFields.c
r42102 r42389 640 640 if (!strcasecmp (fieldName, "PSF_QF")) ESCAPE (MEAS_PSF_QF, OPIHI_FLT); 641 641 if (!strcasecmp (fieldName, "PSF_QF_PERFECT")) ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT); 642 if (!strcasecmp (fieldName, "PSFQF")) ESCAPE (MEAS_PSF_QF, OPIHI_FLT); 643 if (!strcasecmp (fieldName, "PSFQF_PERFECT")) ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT); 644 if (!strcasecmp (fieldName, "PSFQFPERFECT")) ESCAPE (MEAS_PSF_QF_PERFECT, OPIHI_FLT); 642 645 if (!strcasecmp (fieldName, "PSF_CHISQ")) ESCAPE (MEAS_PSF_CHISQ, OPIHI_FLT); 643 646 if (!strcasecmp (fieldName, "PSF_NDOF")) ESCAPE (MEAS_PSF_NDOF, OPIHI_INT); -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_REF.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_SIM.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V1.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V2.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V3.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V4.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5_LOAD.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V6.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c
r40291 r42389 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; -
trunk/Ohana/src/libdvo/src/skydb.c
r38553 r42389 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 ++; -
trunk/Ohana/src/libdvo/src/skyregion_gsc.c
r41738 r42389 247 247 int i; 248 248 double Rmin, Rmax, Dmin, Dmax; 249 char temp[ 80], name[80];249 char temp[50], name[80]; 250 250 SkyTable *band; 251 251 SkyRegion *regions; … … 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); -
trunk/Ohana/src/libfits/header/F_convert_H.c
r15487 r42389 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 -
trunk/Ohana/src/libfits/header/F_create_H.c
r34577 r42389 12 12 13 13 ALLOCATE (header[0].buffer, char, NBYTES); 14 bzero (header[0].buffer, NBYTES); 14 15 15 for (i = 0; i < NBYTES; i++) 16 header[0].buffer[i] = ' '; 17 strncpy (header[0].buffer, "END", 3); 16 for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' '; 17 header[0].buffer[0] = 'E'; 18 header[0].buffer[1] = 'N'; 19 header[0].buffer[2] = 'D'; 18 20 19 21 gfits_modify_alt (header, "SIMPLE", "%t", 1, header[0].simple); … … 22 24 23 25 for (i = 0; i < header[0].Naxes; i++) { 24 snprintf (axis, 10, "NAXIS%d", i + 1);26 snprintf_nowarn (axis, 10, "NAXIS%d", i + 1); 25 27 gfits_modify (header, axis, OFF_T_FMT, 1, header[0].Naxis[i]); 26 28 } -
trunk/Ohana/src/libfits/header/F_modify.c
r38441 r42389 8 8 /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */ 9 9 10 char comment[82], string[82], data[82]; 10 // the output string needs to be long enough to keep the compiler from 11 // complaining, even though the string cannot be more than 80 chars 12 char comment[82], string[200], data[82]; 11 13 char *p, *qe; 12 14 va_list argp; … … 14 16 va_start (argp, N); 15 17 bzero (data, 82); 16 bzero (string, 82);18 bzero (string, 200); 17 19 bzero (comment, 82); 18 20 … … 46 48 qe += 3; 47 49 qe = MIN (p + 80, qe); 48 strncpy (comment, qe, p + 80 - qe);50 strncpy_nowarn (comment, qe, p + 80 - qe); 49 51 } 50 52 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 51 53 52 54 /* write the numeric modes */ 53 if (!strcmp (mode, "%d")) { snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int),comment); goto found_it; }54 if (!strcmp (mode, "%ld")) { snprintf (string, 81, "%-8s= %20ld / %-s ", field, va_arg (argp, long),comment); goto found_it; }55 if (!strcmp (mode, "%lld")) { snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long),comment); goto found_it; }56 if (!strcmp (mode, "%Ld")) { snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long),comment); goto found_it; }57 if (!strcmp (mode, "%u")) { snprintf (string, 81, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned),comment); goto found_it; }58 if (!strcmp (mode, "%lu")) { snprintf (string, 81, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); goto found_it; }59 if (!strcmp (mode, "%llu")) { snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; }60 if (!strcmp (mode, "%Lu")) { snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; }61 if (!strcmp (mode, "%hd")) { snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int),comment); goto found_it; }62 if (!strcmp (mode, "%f")) { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),comment); goto found_it; }63 if (!strcmp (mode, "%lf")) { snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double),comment); goto found_it; }64 if (!strcmp (mode, "%e")) { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),comment); goto found_it; }65 if (!strcmp (mode, "%le")) { snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double),comment); goto found_it; }66 if (!strcmp (mode, "%g")) { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),comment); goto found_it; }67 if (!strcmp (mode, "%lg")) { snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double),comment); goto found_it; }68 if (!strcmp (mode, "%jd")) { snprintf (string, 81, "%-8s= %20jd / %-s ", field, va_arg (argp, intmax_t),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 if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); goto found_it; } 61 if (!strcmp (mode, "%llu")) { snprintf (string, 200, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); goto found_it; } 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; } 69 71 70 72 /* string value. Quotes must be at least 8 chars apart */ … … 72 74 char *ptr = va_arg (argp, char *); 73 75 if (!ptr) goto invalid; 74 strncpy (data, ptr, 68);75 snprintf (string, 81, "%-8s= '%-8s' / %-s ", field, data, comment);76 strncpy_nowarn (data, ptr, 68); 77 snprintf (string, 200, "%-8s= '%-8s' / %-s ", field, data, comment); 76 78 goto found_it; 77 79 } … … 83 85 84 86 found_it: 85 strncpy (p, string, 80);87 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 86 88 va_end (argp); 87 89 return (TRUE); … … 94 96 /* this function is extremely similar to gfits_print, except it allows for changing an existing field. */ 95 97 96 char comment[82], string[ 82], data[82];98 char comment[82], string[200], data[82]; 97 99 char *p, *qs, *qe; 98 100 va_list argp; … … 100 102 va_start (argp, N); 101 103 bzero (data, 82); 102 bzero (string, 82);103 104 bzero (comment, 82); 105 bzero (string, 200); 104 106 105 107 if (mode[0] != '%') { … … 132 134 qe += 3; 133 135 qe = MIN (p + 80, qe); 134 strncpy (comment, qe, p + 80 - qe);136 strncpy_nowarn (comment, qe, p + 80 - qe); 135 137 } 136 138 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ … … 139 141 if (!strcmp (mode, "%t")) { 140 142 if (va_arg (argp, int)) 141 snprintf (string, 81, "%-8s= %18s T / %-s ", field, " ", comment);143 snprintf (string, 200, "%-8s= %18s T / %-s ", field, " ", comment); 142 144 else 143 snprintf (string, 81, "%-8s= %18s F / %-s ", field, " ", comment);145 snprintf (string, 200, "%-8s= %18s F / %-s ", field, " ", comment); 144 146 } 145 147 … … 148 150 char *ptr = va_arg (argp, char *); 149 151 if (!ptr) goto invalid; 150 strncpy (data, ptr, 71);151 snprintf (string, 81, "%-8s %-71s", field, data);152 strncpy_nowarn (data, ptr, 71); 153 snprintf (string, 200, "%-8s %-71s", field, data); 152 154 } 153 155 … … 161 163 if (qs[-1] == 0x27) qs --; 162 164 163 strncpy (data, qs, MAX (MIN (qe - qs, 71), 0));165 strncpy_nowarn (data, qs, MAX (MIN (qe - qs, 71), 0)); 164 166 165 167 char *ptr = va_arg (argp, char *); 166 168 if (!ptr) goto invalid; 167 strncpy (comment, ptr, 80);169 strncpy_nowarn (comment, ptr, 80); 168 170 gfits_pad_ending (comment, 0x20, 82); /* comment must contain spaces to the end */ 169 snprintf (string, 81, "%-8s= %s / %-s", field, data, comment);171 snprintf (string, 200, "%-8s= %s / %-s", field, data, comment); 170 172 /* this will keep the original line, but truncate the comment */ 171 173 } 172 174 173 strncpy (p, string, 80);175 memcpy (p, string, 80); // do not use strncpy_nowarn: do NOT set last byte to NULL 174 176 va_end (argp); 175 177 return (TRUE); -
trunk/Ohana/src/libfits/header/F_print.c
r34577 r42389 8 8 9 9 static char blank[] = " "; 10 char string[ 82], line[80];10 char string[200], line[80]; 11 11 char *p; 12 12 va_list argp; … … 46 46 47 47 /* write the numeric modes */ 48 if (!strcmp (mode, "%d")) { snprintf (string, 81, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; }49 if (!strcmp (mode, "%ld")) { snprintf (string, 81, "%-8s= %20ld / %46s ", field, va_arg (argp, long), blank); goto found_it; }50 if (!strcmp (mode, "%lld")){ snprintf (string, 81, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; }51 if (!strcmp (mode, "%Ld")) { snprintf (string, 81, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; }52 if (!strcmp (mode, "%u")) { snprintf (string, 81, "%-8s= %20u / %46s ", field, va_arg (argp, unsigned), blank); goto found_it; }53 if (!strcmp (mode, "%lu")) { snprintf (string, 81, "%-8s= %20lu / %46s ", field, va_arg (argp, unsigned long), blank); goto found_it; }54 if (!strcmp (mode, "%llu")){ snprintf (string, 81, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; }55 if (!strcmp (mode, "%Lu")) { snprintf (string, 81, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; }56 if (!strcmp (mode, "%hd")) { snprintf (string, 81, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; }57 if (!strcmp (mode, "%f")) { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; }58 if (!strcmp (mode, "%lf")) { snprintf (string, 81, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; }59 if (!strcmp (mode, "%e")) { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; }60 if (!strcmp (mode, "%le")) { snprintf (string, 81, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; }61 if (!strcmp (mode, "%g")) { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; }62 if (!strcmp (mode, "%lg")) { snprintf (string, 81, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; }63 if (!strcmp (mode, "%jd")) { snprintf (string, 81, "%-8s= %20jd / %46s ", field, va_arg (argp, intmax_t), blank); goto found_it; }48 if (!strcmp (mode, "%d")) { snprintf (string, 200, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; } 49 if (!strcmp (mode, "%ld")) { snprintf (string, 200, "%-8s= %20ld / %46s ", field, va_arg (argp, long), blank); goto found_it; } 50 if (!strcmp (mode, "%lld")){ snprintf (string, 200, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; } 51 if (!strcmp (mode, "%Ld")) { snprintf (string, 200, "%-8s= %20lld / %46s ", field, va_arg (argp, long long), blank); goto found_it; } 52 if (!strcmp (mode, "%u")) { snprintf (string, 200, "%-8s= %20u / %46s ", field, va_arg (argp, unsigned), blank); goto found_it; } 53 if (!strcmp (mode, "%lu")) { snprintf (string, 200, "%-8s= %20lu / %46s ", field, va_arg (argp, unsigned long), blank); goto found_it; } 54 if (!strcmp (mode, "%llu")){ snprintf (string, 200, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; } 55 if (!strcmp (mode, "%Lu")) { snprintf (string, 200, "%-8s= %20llu / %46s ", field, va_arg (argp, unsigned long long), blank); goto found_it; } 56 if (!strcmp (mode, "%hd")) { snprintf (string, 200, "%-8s= %20d / %46s ", field, va_arg (argp, int), blank); goto found_it; } 57 if (!strcmp (mode, "%f")) { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; } 58 if (!strcmp (mode, "%lf")) { snprintf (string, 200, "%-8s= %20.10f / %46s ", field, va_arg (argp, double), blank); goto found_it; } 59 if (!strcmp (mode, "%e")) { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; } 60 if (!strcmp (mode, "%le")) { snprintf (string, 200, "%-8s= %20.10E / %46s ", field, va_arg (argp, double), blank); goto found_it; } 61 if (!strcmp (mode, "%g")) { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; } 62 if (!strcmp (mode, "%lg")) { snprintf (string, 200, "%-8s= %20.10G / %46s ", field, va_arg (argp, double), blank); goto found_it; } 63 if (!strcmp (mode, "%jd")) { snprintf (string, 200, "%-8s= %20jd / %46s ", field, va_arg (argp, intmax_t), blank); goto found_it; } 64 64 65 65 /* string value. Quotes must be at least 8 chars apart. Longer lines will this should be fixed to allow arbitrary string lengths, up to 69 chars */ … … 69 69 strcpy (line, ptr); 70 70 line[68] = 0; 71 snprintf (string, 81, "%-8s= '%-8s' / %46s ", field, line, blank);71 snprintf (string, 200, "%-8s= '%-8s' / %46s ", field, line, blank); 72 72 goto found_it; 73 73 } … … 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); … … 89 89 90 90 static char blank[] = " "; 91 char string[ 82], line[80];91 char string[200], line[80]; 92 92 char *p, a; 93 93 va_list argp; … … 126 126 a = va_arg (argp, int); 127 127 if (a == 1) 128 snprintf (string, 81, "%-8s= %18s T / %46s ", field, blank, blank);128 snprintf (string, 200, "%-8s= %18s T / %46s ", field, blank, blank); 129 129 else 130 snprintf (string, 81, "%-8s= %18s F / %46s ", field, blank, blank);130 snprintf (string, 200, "%-8s= %18s F / %46s ", field, blank, blank); 131 131 } 132 132 … … 137 137 if (!ptr) goto invalid; 138 138 bzero (line, 80); 139 strncpy (line, ptr, 71);140 snprintf (string, 81, "%-8s %-71s", field, line);139 strncpy_nowarn (line, ptr, 71); 140 snprintf (string, 200, "%-8s %-71s", field, line); 141 141 } 142 142 … … 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); -
trunk/Ohana/src/libfits/header/F_scan.c
r39324 r42389 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 } -
trunk/Ohana/src/libfits/matrix/F_compress_M.c
r41739 r42389 86 86 char keyword[11]; 87 87 for (i = 0; i < header[0].Naxes; i++) { 88 snprintf (keyword, 10, "ZNAXIS%d", i + 1);88 snprintf_nowarn (keyword, 10, "ZNAXIS%d", i + 1); 89 89 if (!gfits_modify (theader, keyword, OFF_T_FMT, 1, header[0].Naxis[i])) ESCAPE; 90 90 } 91 91 92 92 for (i = 0; i < header->Naxes; i++) { 93 snprintf (keyword, 10, "ZTILE%d", i + 1);93 snprintf_nowarn (keyword, 10, "ZTILE%d", i + 1); 94 94 if (!gfits_modify (theader, keyword, "%lu", 1, ztile[i])) ESCAPE; 95 95 } … … 131 131 // note the difference between the keywords (1 indexed) and the variables (0 indexed) 132 132 for (i = 0; i < Noptions; i++) { 133 snprintf (key, 10, "ZNAME%d", i + 1);133 snprintf_nowarn (key, 10, "ZNAME%d", i + 1); 134 134 if (!gfits_modify (header, key, "%s", 1, optname[i])) break; 135 135 136 snprintf (key, 10, "ZVAL%d", i + 1);136 snprintf_nowarn (key, 10, "ZVAL%d", i + 1); 137 137 if (!gfits_modify (header, key, "%s", 1, optvalue[i])) break; 138 138 } -
trunk/Ohana/src/libfits/matrix/F_uncompress_M.c
r41474 r42389 90 90 int axis; 91 91 for (axis = 0; axis < header->Naxes; axis++) { 92 snprintf (zaxis, 10, "ZNAXIS%d", axis + 1);93 snprintf (naxis, 10, "NAXIS%d",axis + 1);92 snprintf_nowarn (zaxis, 10, "ZNAXIS%d", axis + 1); 93 snprintf_nowarn (naxis, 10, "NAXIS%d", axis + 1); 94 94 MOD_KEYWORD_REQUIRED (zaxis, naxis, OFF_T_FMT, &header->Naxis[axis], header->Naxis[axis]); 95 95 } … … 108 108 // if ZTILE1 exists, all ZTILEn must exist: 109 109 for (axis = 1; axis < header->Naxes; axis++) { 110 snprintf (key, 10, "ZTILE%d", axis + 1);110 snprintf_nowarn (key, 10, "ZTILE%d", axis + 1); 111 111 if (!gfits_scan (header, key, "%lu", 1, &ztile[axis])) ESCAPE; 112 112 gfits_delete (header, key, 1); -
trunk/Ohana/src/libfits/table/F_create_TH.c
r38989 r42389 17 17 myAssert (!header->buffer, "failed to init header or free buffer?"); 18 18 ALLOCATE (header[0].buffer, char, NBYTES); 19 bzero (header[0].buffer, NBYTES); 19 20 20 for (i = 0; i < NBYTES; i++) 21 header[0].buffer[i] = ' '; 22 strncpy (header[0].buffer, "END", 3); 21 for (i = 0; i < NBYTES; i++) header[0].buffer[i] = ' '; 22 header[0].buffer[0] = 'E'; 23 header[0].buffer[1] = 'N'; 24 header[0].buffer[2] = 'D'; 23 25 24 26 gfits_modify (header, "XTENSION", "%s", 1, type); -
trunk/Ohana/src/libfits/table/F_get_T_column.c
r38553 r42389 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; -
trunk/Ohana/src/libfits/table/F_get_T_value.c
r38553 r42389 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); -
trunk/Ohana/src/libfits/table/F_table_column.c
r38553 r42389 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: -
trunk/Ohana/src/libkapa/src/RotFont.c
r41341 r42389 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); -
trunk/Ohana/src/libohana/include/ohana.h
r41468 r42389 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)); -
trunk/Ohana/src/libohana/src/findexec.c
r39457 r42389 256 256 } 257 257 258 # define OHANA_MAX_PATH 1024 259 # define OHANA_MAX_NAME 1280 258 260 char *findexec (int argc, char **argv) { 259 261 260 262 int i, N, done, status; 261 char *c, *e, *dir, path[ 1024], name[1024];263 char *c, *e, *dir, path[OHANA_MAX_PATH], name[OHANA_MAX_NAME]; 262 264 263 265 /* if given an absolute or relative path, use it */ … … 286 288 i = 0; 287 289 while (!done) { 288 bzero (path, 1024);290 bzero (path, OHANA_MAX_PATH); 289 291 if (e == (char *) NULL) { 290 292 done = TRUE; 291 strncpy (path, c, strlen(c));293 strncpy_nowarn (path, c, strlen(c)); 292 294 } else { 293 strncpy (path, c, e-c);295 strncpy_nowarn (path, c, e-c); 294 296 c = e+1; 295 297 e = strchr (c, ':'); 296 298 } 297 snprintf (name, 1024, "%s/%s", path, argv[0]);299 snprintf (name, OHANA_MAX_NAME, "%s/%s", path, argv[0]); 298 300 status = check_file_exec (name); 299 301 -
trunk/Ohana/src/libohana/src/string.c
r40549 r42389 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; -
trunk/Ohana/src/misc/src/cfhtlog.c
r18 r42389 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 } -
trunk/Ohana/src/misc/src/fakecmp.c
r27435 r42389 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 -
trunk/Ohana/src/misc/src/gtfringetable.c
r7080 r42389 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); -
trunk/Ohana/src/misc/src/mkfringetable.c
r14590 r42389 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); -
trunk/Ohana/src/mosastro/src/getstone.c
r3323 r42389 28 28 ®ions[Nregion].RA[0], ®ions[Nregion].RA[1], 29 29 ®ions[Nregion].DEC[0], ®ions[Nregion].DEC[1]); 30 s printf (line, "%s/%s", StoneRegions, filename);30 snprintf_nowarn (line, 1024, "%s/%s", StoneRegions, filename); 31 31 regname[Nregion] = strcreate (line); 32 32 Nregion ++; -
trunk/Ohana/src/mosastro/src/getusno.c
r27435 r42389 9 9 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10}; 10 10 11 # define MY_MAX_PATH 256 12 11 13 StarData *getusno (CatStats *catstats, int *Nstars) { 12 14 … … 15 17 float hours[100]; 16 18 int start[100], number[100], *buffer, *buf; 17 char filename[ 128];19 char filename[MY_MAX_PATH]; 18 20 FILE *f; 19 21 int iRA0, iRA1, iDEC0, iDEC1; … … 59 61 60 62 /* load accelerator file */ 61 s printf (filename, "%s/zone%04d.acc", USNO_A_DIR, spd);63 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.acc", USNO_A_DIR, spd); 62 64 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 63 65 f = fopen (filename, "r"); … … 82 84 83 85 /* open data file */ 84 s printf (filename, "%s/zone%04d.cat", USNO_A_DIR, spd);86 snprintf_nowarn (filename, MY_MAX_PATH, "%s/zone%04d.cat", USNO_A_DIR, spd); 85 87 if (VERBOSE) fprintf (stderr, "reading from %s\n", filename); 86 88 f = fopen (filename, "r"); -
trunk/Ohana/src/mosastro/src/getusnob.c
r34088 r42389 2 2 # define NBYTE 4 3 3 # define NELEM 20 4 5 # define MY_MAX_PATH 256 4 6 5 7 StarData *getusnob (CatStats *catstats, int *Nstars) { … … 9 11 float hours[100]; 10 12 int start[100], number[100], *buffer, *buf; 11 char filename[ 128];13 char filename[MY_MAX_PATH]; 12 14 FILE *f; 13 15 double DEC1; … … 42 44 43 45 /* load accelerator file */ 44 s printf (filename, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd);46 snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.acc", USNO_B_DIR, (int)(spd/10), spd); 45 47 fprintf (stderr, "reading from %s\n", filename); 46 48 f = fopen (filename, "r"); … … 65 67 66 68 /* open data file */ 67 s printf (filename, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd);69 snprintf_nowarn (filename, MY_MAX_PATH, "%s/%03d/b%04d.cat", USNO_B_DIR, (int)(spd/10), spd); 68 70 fprintf (stderr, "reading from %s\n", filename); 69 71 f = fopen (filename, "r"); -
trunk/Ohana/src/mosastro/src/output.c
r27435 r42389 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); -
trunk/Ohana/src/nightd/include/nightd.h
r21153 r42389 3 3 # include <errno.h> 4 4 5 # define MY_MAX_PATH 256 6 5 7 FILE *LogFile; 6 8 char *Program; 7 9 8 char logfile[ 256];10 char logfile[MY_MAX_PATH]; 9 11 char **MainCommand; 10 12 char **InitCommand; 11 13 char **DoneCommand; 12 14 13 char TestCommand[ 256];15 char TestCommand[MY_MAX_PATH]; 14 16 15 char DateStr[ 256];16 char TimeStr[ 256];17 char DateStr[MY_MAX_PATH]; 18 char TimeStr[MY_MAX_PATH]; 17 19 18 char PIDFile[ 256];20 char PIDFile[MY_MAX_PATH]; 19 21 20 22 float NightStart; -
trunk/Ohana/src/nightd/src/GetStatus.c
r27611 r42389 23 23 int ResetConfig () { 24 24 25 char user[ 256], machine[256], line[256];25 char user[MY_MAX_PATH], machine[MY_MAX_PATH], line[MY_MAX_PATH]; 26 26 pid_t pid; 27 27 … … 32 32 } 33 33 34 s printf (line, "rsh %s kill -USR1 %d", machine, pid);34 snprintf_nowarn (line, MY_MAX_PATH, "rsh %s kill -USR1 %d", machine, pid); 35 35 if (system (line) == -1) { 36 36 fprintf (stderr, "failed to send signal\n"); … … 42 42 int SendShutdown () { 43 43 44 char user[ 256], machine[256], line[256];44 char user[MY_MAX_PATH], machine[MY_MAX_PATH], line[MY_MAX_PATH]; 45 45 pid_t pid; 46 46 … … 51 51 } 52 52 53 s printf (line, "rsh %s kill -TERM %d", machine, pid);53 snprintf_nowarn (line, MY_MAX_PATH, "rsh %s kill -TERM %d", machine, pid); 54 54 if (system (line) == -1) { 55 55 fprintf (stderr, "failed to send signal\n"); -
trunk/Ohana/src/nightd/src/misc.c
r27611 r42389 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++); -
trunk/Ohana/src/opihi/Makefile.Common
r13615 r42389 42 42 @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi 43 43 rm -f $@ 44 gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc 44 # gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc 45 gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc -Wl,--allow-multiple-definition 45 46 46 47 $(DESTLIB)/%.so: $(LIB)/%.$(ARCH).so -
trunk/Ohana/src/opihi/cmd.basic/list.c
r42081 r42389 111 111 set_str_variable (line, argv[i+3]); 112 112 } 113 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);113 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 114 114 set_int_variable (line, i); 115 115 … … 133 133 int isFound; 134 134 135 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);135 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 136 136 int nList = get_int_variable (line, &isFound); 137 137 if (!isFound) { … … 145 145 146 146 for (i = start; i < nList; i++) { 147 snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);147 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i); 148 148 char *word = get_variable (line); 149 149 if (!word) break; 150 150 if (i > 0) { 151 snprintf (output, MAX_LINE_LENGTH, "%s %s", tmpline, word);151 snprintf_nowarn (output, MAX_LINE_LENGTH, "%s %s", tmpline, word); 152 152 } else { 153 snprintf (output, MAX_LINE_LENGTH, "%s", word);153 snprintf_nowarn (output, MAX_LINE_LENGTH, "%s", word); 154 154 } 155 155 strcpy (tmpline, output); … … 179 179 180 180 // old list must exist, or give an error 181 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[3]);181 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[3]); 182 182 N = get_int_variable (line, &found); 183 183 if (!found) { … … 188 188 189 189 190 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);190 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 191 191 set_int_variable (line, N); 192 192 for (i = 0; i < N; i++) { 193 snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[3], i);193 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[3], i); 194 194 value = get_variable (line); 195 // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);195 // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i); 196 196 set_list_varname (line, argv[1], i, EXCEL_STYLE); 197 197 set_str_variable (line, value); … … 207 207 } 208 208 209 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);209 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 210 210 N = get_int_variable (line, &found); 211 211 for (i = 0; i < argc - 3; i++) { 212 // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], N + i);212 // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], N + i); 213 213 set_list_varname (line, argv[1], N + i, EXCEL_STYLE); 214 214 set_str_variable (line, argv[i+3]); 215 215 } 216 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);216 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 217 217 set_int_variable (line, N + i); 218 218 … … 231 231 char line2[MAX_LINE_LENGTH]; 232 232 233 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n233 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n 234 234 N = get_int_variable (line, &found); 235 235 236 236 // loop over all list elements: 237 237 for (i = 0; i < N; i++) { 238 // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);238 // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i); 239 239 set_list_varname (line, argv[1], i, EXCEL_STYLE); // line = LIST:i 240 240 value = get_variable (line); … … 245 245 free (value); 246 246 for (j = i + 1; j < N; j++) { 247 // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], j);247 // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], j); 248 248 set_list_varname (line2, argv[1], j, EXCEL_STYLE); // line2 = LIST:j 249 249 next_value = get_variable (line2); … … 252 252 } 253 253 DeleteNamedScalar (line); // line = LIST:(N-1) 254 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n (new value of n)254 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); // line = LIST:n (new value of n) 255 255 set_int_variable (line, N - 1); 256 256 return (TRUE); … … 309 309 depth --; 310 310 if (depth < 0) { /* we hit the last "END", loop is done */ 311 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);311 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 312 312 set_int_variable (line, i); 313 313 free (input); … … 317 317 318 318 if (*input) { 319 // snprintf (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i);319 // snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:%d", argv[1], i); 320 320 set_list_varname (line, argv[1], i, EXCEL_STYLE); 321 321 set_str_variable (line, input); … … 381 381 free (val); 382 382 383 snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);383 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname); 384 384 set_int_variable (line, i); 385 385 return (TRUE); … … 399 399 // otherwise save all glob matches 400 400 if (globList.gl_pathc == 0) { 401 snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);401 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname); 402 402 set_int_variable (line, 0); 403 403 return TRUE; … … 409 409 set_str_variable (line, globList.gl_pathv[i]); 410 410 } 411 snprintf (line, MAX_LINE_LENGTH, "%s:n", listname);411 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", listname); 412 412 set_int_variable (line, Nfile); 413 413 return (TRUE); … … 430 430 Nline ++; 431 431 } 432 snprintf (varname, MAX_LINE_LENGTH, "%s:n", listname);432 snprintf_nowarn (varname, MAX_LINE_LENGTH, "%s:n", listname); 433 433 set_int_variable (varname, Nline); 434 434 return TRUE; … … 463 463 FREE (new); 464 464 } 465 snprintf (line, MAX_LINE_LENGTH, "%s:n", argv[1]);465 snprintf_nowarn (line, MAX_LINE_LENGTH, "%s:n", argv[1]); 466 466 set_int_variable (line, nWords); 467 467 -
trunk/Ohana/src/opihi/cmd.basic/memory.c
r41341 r42389 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 } -
trunk/Ohana/src/opihi/cmd.basic/run_while.c
r31667 r42389 72 72 // test the logic once before running the loop 73 73 logic_line = strcreate (argv[1]); 74 logic_line = expand_vars (logic_line); 74 logic_line = expand_vars (logic_line); // recalculates scalar elements 75 logic_line = expand_vectors (logic_line); // recalculates vector/matrix elements (e.g., vec[]) 75 76 val = dvomath (1, &logic_line, &size, 0); 76 77 free (logic_line); … … 90 91 91 92 logic_line = strcreate (argv[1]); 92 logic_line = expand_vars (logic_line); 93 logic_line = expand_vars (logic_line); // recalculates scalar elements 94 logic_line = expand_vectors (logic_line); // recalculates vector/matrix elements (e.g., vec[]) 93 95 val = dvomath (1, &logic_line, &size, 0); 94 96 free (logic_line); -
trunk/Ohana/src/opihi/cmd.data/Makefile
r42128 r42389 140 140 $(SRC)/radial.$(ARCH).o \ 141 141 $(SRC)/rd.$(ARCH).o \ 142 $(SRC)/rdjpg.$(ARCH).o \ 142 143 $(SRC)/rdseg.$(ARCH).o \ 143 144 $(SRC)/read_vectors.$(ARCH).o \ … … 154 155 $(SRC)/set.$(ARCH).o \ 155 156 $(SRC)/shift.$(ARCH).o \ 157 $(SRC)/opihi_size.$(ARCH).o \ 156 158 $(SRC)/sort.$(ARCH).o \ 157 159 $(SRC)/spline.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/cursor.c
r39457 r42389 42 42 KiiCursorRead (kapa, &X, &Y, &Z, &R, &D, key); 43 43 44 sprintf (string, "X%s", key); 45 set_variable (string, X); 46 sprintf (string, "Y%s", key); 47 set_variable (string, Y); 48 sprintf (string, "Z%s", key); 49 set_variable (string, Z); 50 sprintf (string, "R%s", key); 51 set_variable (string, R); 52 sprintf (string, "D%s", key); 53 set_variable (string, D); 44 snprintf_nowarn (string, 20, "X%s", key); set_variable (string, X); 45 snprintf_nowarn (string, 20, "Y%s", key); set_variable (string, Y); 46 snprintf_nowarn (string, 20, "Z%s", key); set_variable (string, Z); 47 snprintf_nowarn (string, 20, "R%s", key); set_variable (string, R); 48 snprintf_nowarn (string, 20, "D%s", key); set_variable (string, D); 54 49 55 50 set_str_variable ("KEY", key); -
trunk/Ohana/src/opihi/cmd.data/init.c
r42128 r42389 126 126 int queue2book PROTO((int, char **)); 127 127 int rd PROTO((int, char **)); 128 int rdjpg PROTO((int, char **)); 128 129 int rdseg PROTO((int, char **)); 129 130 int read_vectors PROTO((int, char **)); … … 160 161 int tvgrid PROTO((int, char **)); 161 162 int opihi_type PROTO((int, char **)); 163 int opihi_size PROTO((int, char **)); 162 164 int uniq PROTO((int, char **)); 163 165 int uniqpair PROTO((int, char **)); … … 336 338 {1, "ipptool2book", queue2book, "convert queue with ipptool output to book"}, 337 339 {1, "rd", rd, "load fits image"}, 340 {1, "rdjpg", rdjpg, "load jpeg image"}, 338 341 {1, "rdseg", rdseg, "read a segment of an image from a file"}, 339 342 {1, "read", read_vectors, "read vectors from datafile"}, … … 350 353 {1, "set", set, "image and vector math"}, 351 354 {1, "shift", shift, "shift data in an image"}, 355 {1, "size", opihi_size, "get vector/matrix dimension/size information"}, 352 356 {1, "sort", sort_vectors, "sort list of vectors"}, 353 357 {1, "spline", spline_command, "shift data in an image"}, -
trunk/Ohana/src/opihi/cmd.data/limits.c
r40291 r42389 61 61 APPLY = TRUE; 62 62 } 63 63 64 char *name = NULL; 64 65 if ((N = get_argument (argc, argv, "-n"))) { … … 67 68 remove_argument (N, &argc, argv); 68 69 } 69 70 70 if (!GetGraph (&graphmode, &kapa, name)) return (FALSE); 71 71 FREE (name); 72 73 // this is not super intuitive 74 if ((N = get_argument (argc, argv, "-boxsize"))) { 75 remove_argument (N, &argc, argv); 76 float dx, dy; 77 // ask kapa for the size of the graph region in pixels 78 KapaGetLimits (kapa, &dx, &dy); 79 set_variable ("KAPA_XPIX", fabs(dx)); 80 set_variable ("KAPA_YPIX", fabs(dy)); 81 } 72 82 73 83 // XXX need an option to set the limits based on the current image bounds … … 169 179 return (TRUE); 170 180 } 181 182 /* -minX value : the minimum X axis value will be no higher than this value 183 -maxX value : the maximum X axis value will be no lower than this value 184 -delX value : the range of the X axis will be at least this value 185 186 These can be used to prevent the range from collapsing. 187 These are only used if the -a option is supplied, otherwise the supplied or auto-calculated 188 ranges are used (this seems like an poor choice) 189 190 */ 191 192 193 -
trunk/Ohana/src/opihi/cmd.data/read_vectors.c
r42082 r42389 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 } -
trunk/Ohana/src/opihi/cmd.data/reindex.c
r42082 r42389 72 72 } 73 73 } 74 if (ivec->type == OPIHI_STR) { 75 opihi_int *vx = xvec[0].elements.Int; 76 for (Npts = i = 0; i < xvec[0].Nelements; i++, vx++) { 77 if (Npts >= NPTS) { 78 NPTS += 2000; 79 REALLOCATE (ovec[0].elements.Str, char *, NPTS); 80 } 81 if (*vx < 0) { 82 if (KEEP_UNMATCH) { 83 ovec[0].elements.Str[Npts] = strcreate(""); // XXX use a different or a specified value? 84 Npts++; 85 } 86 continue; 87 } 88 if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i); 89 ovec[0].elements.Str[Npts] = strcreate(ivec->elements.Str[*vx]); 90 Npts++; 91 } 92 } 74 93 75 94 // free up unused memory -
trunk/Ohana/src/opihi/cmd.data/subset.c
r42311 r42389 44 44 ResetVector (ovec, ivec->type, tvec[0].Nelements); 45 45 46 // we have four cases: (ivec == flt or int) and (tvec == flt or int)46 // we have size cases: (ivec == flt, int, str) and (tvec == flt or int) 47 47 if ((ivec->type == OPIHI_FLT) && (tvec->type == OPIHI_FLT)) { 48 48 opihi_flt *vi = ivec[0].elements.Flt; … … 81 81 } 82 82 } 83 // XXX if ivec is an existing vector, this step will 84 // leak (existing elements need to be freed if they 85 // have been allocated). 83 86 if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_FLT)) { 84 87 opihi_flt *vt = tvec[0].elements.Flt; 85 88 for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) { 86 89 if (!*vt) continue; 87 ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);90 ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]); 88 91 Npts++; 89 92 } … … 93 96 for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) { 94 97 if (!*vt) continue; 95 ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);98 ovec[0].elements.Str[Npts] = strcreate(ivec[0].elements.Str[i]); 96 99 Npts++; 97 100 } -
trunk/Ohana/src/opihi/cmd.data/svd.c
r29540 r42389 58 58 59 59 // try C.R. Bond's version -- requires matrices in the form A[row][col] not A[row*Ncol + col] 60 if ( 1) {60 if (0) { 61 61 int j; 62 62 double **a, **u, **v, *q; -
trunk/Ohana/src/opihi/cmd.data/test/histogram.sh
r20936 r42389 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 -
trunk/Ohana/src/opihi/cmd.data/test/join.sh
r36084 r42389 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 -
trunk/Ohana/src/opihi/cmd.data/threshold.c
r42277 r42389 3 3 int QUIET = FALSE; 4 4 5 void _threshold_set_values (double value, int Nbin, double level ) {5 void _threshold_set_values (double value, int Nbin, double level, int thresherr) { 6 6 7 7 set_variable ("threshval", value); 8 8 set_int_variable ("threshbin", Nbin); 9 9 set_variable ("threshold", level); 10 set_int_variable ("thresherr", thresherr); 10 11 11 12 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", level, Nbin, value); … … 117 118 if (vecy[0].elements.Flt[BinMin] > value) { 118 119 if (SATURATE) { 119 _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin] );120 _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1); 120 121 return TRUE; 121 122 } else { 122 123 gprint (GP_ERR, "ERROR: all values above threshold\n"); 123 _threshold_set_values (NAN, -1, NAN );124 _threshold_set_values (NAN, -1, NAN, 1); 124 125 return FALSE; 125 126 } … … 127 128 if (vecy[0].elements.Flt[BinMax] < value) { 128 129 if (SATURATE) { 129 _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax] );130 _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1); 130 131 return TRUE; 131 132 } else { 132 133 gprint (GP_ERR, "ERROR: all values below threshold\n"); 133 _threshold_set_values (NAN, -1, NAN );134 _threshold_set_values (NAN, -1, NAN, 1); 134 135 return FALSE; 135 136 } … … 156 157 if (vecy[0].elements.Flt[BinMin] < value) { 157 158 if (SATURATE) { 158 _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin] );159 _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1); 159 160 return TRUE; 160 161 } else { 161 162 gprint (GP_ERR, "ERROR: all values below threshold\n"); 162 _threshold_set_values (NAN, -1, NAN );163 _threshold_set_values (NAN, -1, NAN, 1); 163 164 return FALSE; 164 165 } … … 166 167 if (vecy[0].elements.Flt[BinMax] > value) { 167 168 if (SATURATE) { 168 _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax] );169 _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1); 169 170 return TRUE; 170 171 } else { 171 172 gprint (GP_ERR, "ERROR: all values above threshold\n"); 172 _threshold_set_values (NAN, -1, NAN );173 _threshold_set_values (NAN, -1, NAN, 1); 173 174 return FALSE; 174 175 } … … 219 220 } 220 221 221 _threshold_set_values (y1, Nhi, Xvalue );222 _threshold_set_values (y1, Nhi, Xvalue, 0); 222 223 return (TRUE); 223 224 } -
trunk/Ohana/src/opihi/cmd.data/tvcolors.c
r41341 r42389 41 41 gprint (GP_ERR, " f: 0 - 1 defines the scale value for the transition\n"); 42 42 gprint (GP_ERR, " R,G,B: 0 - 1 define the value of the color at the transition point\n"); 43 44 gprint (GP_ERR, " There are 5 colormap file format options:\n"); 45 gprint (GP_ERR, " * file:filename : index Red Green Blue\n"); 46 gprint (GP_ERR, " * lgcy:filename : index Red Blue Green\n"); 47 gprint (GP_ERR, " * csvf:filename : index,Red,Green,Blue\n"); 48 gprint (GP_ERR, " * cetf:filename : fRed,fGreen,fBlue \n"); 49 gprint (GP_ERR, " * cetr:filename : fRed,fGreen,fBlue \n\n"); 50 gprint (GP_ERR, " The index value goes from 0.0 to 1.0 and sets transitions (must be monotonic).\n"); 51 gprint (GP_ERR, " In the CET cases, the index is implicit, with 256 entries expected.\n"); 52 gprint (GP_ERR, " For cetr: the index is reversed.\n"); 53 43 54 return (FALSE); 44 55 } -
trunk/Ohana/src/opihi/cmd.data/wd.c
r41674 r42389 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 /// } -
trunk/Ohana/src/opihi/cmd.data/write_vectors.c
r42127 r42389 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': -
trunk/Ohana/src/opihi/dvo/aregion.c
r27435 r42389 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; -
trunk/Ohana/src/opihi/dvo/coordmosaic.c
r39233 r42389 311 311 312 312 memset (segment, 0, 16); memcpy (segment, &SEGMENT[i*Nsegment], 4); 313 snprintf (name, 16, "%s_L_CX%dY%d", segment, XORDER[i], YORDER[i]);313 snprintf_nowarn (name, 16, "%s_L_CX%dY%d", segment, XORDER[i], YORDER[i]); 314 314 double xvalue = get_double_variable (name, &found); 315 315 xmask = !found; 316 316 317 317 memset (segment, 0, 16); memcpy (segment, &SEGMENT[i*Nsegment], 4); 318 snprintf (name, 16, "%s_M_CX%dY%d", segment, XORDER[i], YORDER[i]);318 snprintf_nowarn (name, 16, "%s_M_CX%dY%d", segment, XORDER[i], YORDER[i]); 319 319 double yvalue = get_double_variable (name, &found); 320 320 ymask = !found; … … 437 437 438 438 int found, xmask, ymask; 439 snprintf (name, 16, "L_X%dY%d", ix, iy);439 snprintf_nowarn (name, 16, "L_X%dY%d", ix, iy); 440 440 double xvalue = get_double_variable (name, &found); 441 441 xmask = !found; 442 442 443 snprintf (name, 16, "M_X%dY%d", ix, iy);443 snprintf_nowarn (name, 16, "M_X%dY%d", ix, iy); 444 444 double yvalue = get_double_variable (name, &found); 445 445 ymask = !found; -
trunk/Ohana/src/opihi/dvo/elixir.c
r27611 r42389 4 4 int ReadMsg (char *fifo, char **message); 5 5 6 # define MY_MAX_PATH 256 7 6 8 int elixir (int argc, char **argv) { 7 9 8 char message[ 256], cmd[256], ElixirBase[256];9 char fifo[ 256], fifodir[256], msgfile[256];10 char message[MY_MAX_PATH], cmd[MY_MAX_PATH], ElixirBase[MY_MAX_PATH]; 11 char fifo[MY_MAX_PATH], fifodir[MY_MAX_PATH], msgfile[MY_MAX_PATH]; 10 12 char *answer; 11 13 int N; … … 38 40 return (FALSE); 39 41 } 40 s printf (fifo, "%s.msg", ElixirBase);42 snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase); 41 43 if (!VarConfig ("FIFOS", "%s", fifodir)) { 42 44 gprint (GP_ERR, "FIFOS not in config, using local /tmp\n"); 43 45 strcpy (fifodir, "/tmp"); 44 46 } 45 s printf (fifo, "%s.msg", ElixirBase);47 snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase); 46 48 47 s printf (msgfile, "%s/EMsg.XXXXXX", fifodir);49 snprintf_nowarn (msgfile, MY_MAX_PATH, "%s/EMsg.XXXXXX", fifodir); 48 50 if (mkstemp (msgfile) == -1) { 49 51 gprint (GP_ERR, "can't create fifo\n"); 50 52 return (FALSE); 51 53 } 52 s printf (message, "%s %s", cmd, msgfile);54 snprintf_nowarn (message, MY_MAX_PATH, "%s %s", cmd, msgfile); 53 55 unlink (msgfile); 54 56 -
trunk/Ohana/src/opihi/dvo/find_regions.c
r27435 r42389 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; -
trunk/Ohana/src/opihi/include/dvomath.h
r42083 r42389 125 125 int M_unary PROTO((StackVar *OUT, StackVar *V1, char *op)); 126 126 int W_unary PROTO((StackVar *OUT, StackVar *V1, char *op)); 127 int L_unary PROTO((StackVar *OUT, StackVar *V1, char *op)); 127 128 128 129 /* variable handling */ -
trunk/Ohana/src/opihi/include/pcontrol.h
r36623 r42389 341 341 342 342 void pcontrol_exit (int n); 343 void QuitCheckSystemThread (void); 343 344 344 345 // Job *FindJobByID (IDtype JobID, int *StackID); -
trunk/Ohana/src/opihi/lib.data/svdcmp.c
r34088 r42389 23 23 l = nm = 0; 24 24 ALLOCATE (rv1, float, Nx); 25 25 26 for (i = 0; i < Nx; i++) { 26 27 l = i + 1; … … 29 30 if (i < Ny) { 30 31 for (k = i; k < Ny; k++) scale += fabs(a[k*Nx + i]); 31 if (scale ) {32 if (scale > 0.0) { 32 33 for (k = i; k < Ny; k++) { 33 34 a[k*Nx + i] /= scale; … … 35 36 } 36 37 f = a[i*Nx + i]; 37 g = -FSIGN(sqrt(s), f); 38 g = sqrt(s); 39 if (f > 0.0) { g = -g; } 38 40 h = f*g - s; 39 41 a[i*Nx + i] = f-g; 40 42 if (i != Nx - 1) { 41 43 for (j = l; j < Nx; j++) { 42 for (s = 0.0, k = i; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j]; 44 s = 0.0; 45 for (k = i; k < Ny; k++) { s += a[k*Nx + i]*a[k*Nx + j]; } 43 46 f = s/h; 44 for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];47 for (k = i; k < Ny; k++) { a[k*Nx + j] += f*a[k*Nx + i]; } 45 48 } 46 49 } 47 for (k = i; k < Ny; k++) a[k*Nx + i] *= scale;50 for (k = i; k < Ny; k++) { a[k*Nx + i] *= scale; } 48 51 } 49 52 } … … 51 54 g = s = scale = 0.0; 52 55 if ((i < Ny) && (i != (Nx - 1))) { 53 for (k = l; k < Nx; k++) scale += fabs(a[i*Nx + k]);54 if (scale ) {56 for (k = l; k < Nx; k++) { scale += fabs(a[i*Nx + k]); } 57 if (scale > 0.0) { 55 58 for (k = l; k < Nx; k++) { 56 59 a[i*Nx + k] /= scale; … … 58 61 } 59 62 f = a[i*Nx + l]; 60 g = -FSIGN(sqrt(s), f); 63 g = sqrt(s); 64 if (f > 0.0) { g = -g; } 61 65 h = f*g - s; 62 66 a[i*Nx + l] = f-g; 63 for (k = l; k < Nx; k++) rv1[k] = a[i*Nx + k]/h;67 for (k = l; k < Nx; k++) { rv1[k] = a[i*Nx + k]/h; } 64 68 if (i != Ny - 1) { 65 69 for (j = l; j < Ny; j++) { 66 for (s = 0.0, k = l; k < Nx; k++) s += a[j*Nx + k]*a[i*Nx + k]; 67 for (k = l; k < Nx; k++) a[j*Nx + k] += s*rv1[k]; 70 s = 0.0; 71 for (k = l; k < Nx; k++) { s += a[j*Nx + k]*a[i*Nx + k];} 72 for (k = l; k < Nx; k++) { a[j*Nx + k] += s*rv1[k]; } 68 73 } 69 74 } 70 for (k = l; k < Nx; k++) a[i*Nx + k] *= scale;75 for (k = l; k < Nx; k++) { a[i*Nx + k] *= scale; } 71 76 } 72 77 } … … 76 81 for (i = Nx - 1; i >= 0; i--) { 77 82 if (i < Nx - 1) { 78 if (g ) {83 if (g != 0.0) { 79 84 /* isn't l == n to start?? */ 80 85 for (j = l; j < Nx; j++) v[j*Nx + i] = (a[i*Nx + j]/a[i*Nx + l])/g; 81 86 for (j = l; j < Nx; j++) { 82 for (s = 0.0, k = l; k < Nx; k++) s += a[i*Nx + k]*v[k*Nx + j]; 87 s = 0.0; 88 for (k = l; k < Nx; k++) s += a[i*Nx + k]*v[k*Nx + j]; 83 89 for (k = l; k < Nx; k++) v[k*Nx + j] += s*v[k*Nx + i]; 84 90 } 85 91 } 86 for (j = l; j < Nx; j++) v[i*Nx + j] = v[j*Nx + i] = 0.0;92 for (j = l; j < Nx; j++) { v[i*Nx + j] = v[j*Nx + i] = 0.0; } 87 93 } 88 94 v[i*Nx + i] = 1.0; … … 93 99 l = i + 1; 94 100 g = w[i]; 95 if (i < Nx - 1) 96 for (j = l; j < Nx; j++) a[i*Nx + j] = 0.0; 97 if (g) { 101 if (i < Nx - 1) { for (j = l; j < Nx; j++) {a[i*Nx + j] = 0.0; }} 102 if (g != 0.0) { 98 103 g = 1.0/g; 99 104 if (i != Nx - 1) { 100 105 for (j = l; j < Nx; j++) { 101 for (s = 0.0, k = l; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j]; 106 s = 0.0; 107 for (k = l; k < Ny; k++) { s += a[k*Nx + i]*a[k*Nx + j];} 102 108 f = (s/a[i*Nx + i])*g; 103 for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];104 } 105 } 106 for (j = i; j < Ny; j++) a[j*Nx + i] *= g;109 for (k = i; k < Ny; k++) { a[k*Nx + j] += f*a[k*Nx + i]; } 110 } 111 } 112 for (j = i; j < Ny; j++) { a[j*Nx + i] *= g; } 107 113 } else { 108 for (j = i; j < Ny; j++) a[j*Nx + i] = 0.0;109 } 110 ++a[i*Nx + i];114 for (j = i; j < Ny; j++) { a[j*Nx + i] = 0.0; } 115 } 116 a[i*Nx + i] ++; 111 117 } 112 118 … … 126 132 c = 0.0; 127 133 s = 1.0; 128 for (i = l; i < k; i++) {134 for (i = l; i <= k; i++) { 129 135 f = s*rv1[i]; 130 136 if (fabs(f)+anorm != anorm) { … … 160 166 f = ((y-z)*(y+z) + (g-h)*(g+h))/(2.0*h*y); 161 167 g = hypot (f, 1.0); 162 f = ((x-z)*(x+z) + h*((y/(f+FSIGN(g, f)))-h))/x; 168 169 float tmp = g; 170 if (f < 0.0) { tmp = - tmp; } 171 172 f = ((x-z)*(x+z) + h*((y/(f+tmp))-h))/x; 173 163 174 c = s = 1.0; 164 for (j = l; j < nm; j++) {175 for (j = l; j <= nm; j++) { 165 176 i = j+1; 166 177 g = rv1[i]; … … 184 195 z = hypot(f, h); 185 196 w[j] = z; 186 if (z ) {197 if (z != 0.0) { 187 198 z = 1.0/z; 188 199 c = f*z; -
trunk/Ohana/src/opihi/lib.data/svdcmp_bond_new.c
r29540 r42389 63 63 g = 0.0; 64 64 else { 65 f = u[i][i+1];65 f = u[i][i+1]; // XXXX this line will overrun the memory of u[][i+1] : i+1 66 66 g = (f < 0) ? sqrt(s) : -sqrt(s); 67 67 h = f * g - s; -
trunk/Ohana/src/opihi/lib.shell/VectorIO.c
r42126 r42389 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 -
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
r42080 r42389 67 67 if (stack[0].type == ST_VECTOR) { 68 68 /* need to make a copy so we set output value? */ 69 V_unary (&tmp_stack, &stack[0], "="); 69 if (stack->vector->type == OPIHI_STR) { 70 L_unary (&tmp_stack, &stack[0], "="); 71 } else { 72 V_unary (&tmp_stack, &stack[0], "="); 73 } 70 74 move_stack (&stack[0], &tmp_stack); 71 75 return (TRUE); -
trunk/Ohana/src/opihi/lib.shell/expand_vectors.c
r42080 r42389 28 28 ALLOCATE (newline, char, NLINE); 29 29 30 // special case: don't expand vectors in while () statement 31 char *V0 = thiscomm (line); 32 if (V0 && !strncmp ("while", V0, strlen(V0))) { 33 strcpy (newline, line); 34 free (line); 35 return (newline); 36 } 37 free (V0); 38 30 39 /* look for form fred[stuff] */ 31 /* skip first word (command) */ 32 L = nextword (line); 40 if (*line == '(') { 41 // if line is "(stuff)" then do not skip first word 42 L = line; 43 } else { 44 /* skip first word (command) */ 45 L = nextword (line); 46 } 33 47 if (L == NULL) { 34 48 free (newline); … … 37 51 38 52 n = L - line; 39 strncpy (newline, line, n);53 strncpy_nowarn (newline, line, n); 40 54 N = newline + n; 41 55 J = 0; … … 242 256 243 257 n = (int) (w - L); 244 strncpy (N, L, n);258 strncpy_nowarn (N, L, n); 245 259 N += n; 246 260 n = strlen (strValue); 247 strncpy (N, strValue, n);261 strncpy_nowarn (N, strValue, n); 248 262 N += n; 249 263 L = q + 1; … … 260 274 261 275 n = strlen (L); 262 strncpy (N, L, n); 263 N[n] = 0; 276 strncpy_nowarn (N, L, n); 264 277 free (line); 265 278 return (newline); -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r42311 r42389 1714 1714 char line[512]; // this is only used to report an error 1715 1715 snprintf (line, 512, "error: op %s not defined as unary vector op!", op); 1716 push_error (line); 1717 return (FALSE); 1718 1719 escape: 1720 1721 if (V1[0].type == ST_VECTOR_TMP) { 1722 free (V1[0].vector[0].elements.Ptr); 1723 free (V1[0].vector); 1724 V1[0].vector = NULL; 1725 } 1726 1727 clear_stack (V1); 1728 return (TRUE); 1729 1730 } 1731 1732 // vector string operations 1733 int L_unary (StackVar *OUT, StackVar *V1, char *op) { 1734 1735 int Nx = V1[0].vector[0].Nelements; 1736 1737 OUT[0].vector = InitVector (); 1738 OUT[0].type = ST_VECTOR_TMP; /*** <<--- says this is a temporary matrix ***/ 1739 1740 ResetVector (OUT[0].vector, OPIHI_STR, V1[0].vector[0].Nelements); 1741 char **Iv = V1[0].vector[0].elements.Str; 1742 char **Ov = OUT[0].vector[0].elements.Str; 1743 if (!strcmp (op, "=")) { 1744 for (int i = 0; i < Nx; i++) { 1745 Ov[i] = strcreate (Iv[i]); 1746 } 1747 goto escape; 1748 } 1749 1750 // free the temp vector if needed 1751 if (V1[0].type == ST_VECTOR_TMP) { 1752 // XXX this probably does not free the strings 1753 free (V1[0].vector[0].elements.Ptr); 1754 free (V1[0].vector); 1755 V1[0].vector = NULL; 1756 } 1757 1758 clear_stack (V1); 1759 1760 char line[512]; // this is only used to report an error 1761 snprintf (line, 512, "error: op %s not defined as unary string vector op!", op); 1716 1762 push_error (line); 1717 1763 return (FALSE); -
trunk/Ohana/src/opihi/pantasks/controller_status.c
r37807 r42389 26 26 } 27 27 28 snprintf (command, 1024, "status");28 snprintf_nowarn (command, 1024, "status"); 29 29 for (i = 1; i < argc; i++) { 30 snprintf (tmpline, 1024, "%s %s", command, argv[i]);30 snprintf_nowarn (tmpline, 1024, "%s %s", command, argv[i]); 31 31 strcpy (command, tmpline); 32 32 } -
trunk/Ohana/src/opihi/pantasks/pantasks_server.c.in
r41483 r42389 138 138 ConfigFree (); 139 139 140 // XXX this function is currently called by the thread running ListenClients, but 141 // it should be called by the main above. have this function trigger the 142 // thread shutdown 143 140 144 QuitJobsAndTasksThread(); pthread_join (JobsAndTasksThread, NULL); 141 145 QuitControllerThread(); pthread_join (controllerThread, NULL); -
trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
r39457 r42389 4 4 static struct timeval lastlive = {0, 0}; 5 5 static RunLevels RunLevel = PCONTROL_RUN_NONE; 6 7 static int CheckSystemThreadRuns = TRUE; 8 9 void QuitCheckSystemThread (void) { 10 CheckSystemThreadRuns = FALSE; 11 } 12 6 13 7 14 RunLevels SetRunLevel (RunLevels level) { … … 67 74 gprintInit (); 68 75 69 while ( 1) {76 while (CheckSystemThreadRuns) { 70 77 // stop here if the user-thread requests (no objects in flight) 71 78 TestCheckPoint (); -
trunk/Ohana/src/opihi/pcontrol/pcontrol.c.in
r39457 r42389 9 9 # define opihi_rcfile ".pcontrolrc" 10 10 11 # ifdef THREADED 12 static pthread_t clientsThread; 13 # endif 14 11 15 /* program-dependent initialization */ 12 16 void program_init (int *argc, char **argv) { … … 14 18 OHANA_UNUSED_PARAM(argv); 15 19 16 # ifdef THREADED17 pthread_t clientsThread;18 # endif19 20 20 auto_break = TRUE; 21 21 … … 83 83 SetRunLevel (PCONTROL_RUN_HOSTS); 84 84 DownHosts (); 85 86 QuitCheckSystemThread(); pthread_join (clientsThread, NULL); 87 85 88 ConfigFree (); 86 87 89 FreeBasic (); 88 90 FreePcontrol (); -
trunk/Ohana/src/opihi/pcontrol/test/linesize.sh
r18114 r42389 27 27 28 28 for i 1 10 29 job echo $inline 729 job echo $inline6 30 30 end 31 31 … … 34 34 for i 1 10 35 35 stdout $i -var outline 36 strlen "$inline 7" Nin36 strlen "$inline6" Nin 37 37 strlen "$outline" Nout 38 38 -
trunk/Ohana/src/opihi/test/tests.sh
r41470 r42389 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 -
trunk/Ohana/src/photdbc/src/ConfigInit.c
r38441 r42389 13 13 14 14 char *config, *file; 15 char CatdirPhotcodeFile[ 256];15 char CatdirPhotcodeFile[DVO_MAX_PATH]; 16 16 17 17 /*** load configuration info ***/ … … 59 59 free (tmpcatdir); 60 60 61 s printf (ImageCat, "%s/Images.dat", CATDIR);61 snprintf_nowarn (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR); 62 62 63 63 WarnConfig (config, "ZERO_PT", "%lf", 0, &ZERO_POINT); … … 72 72 73 73 /* XXX this does not yet write out the master photcode table */ 74 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);74 snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR); 75 75 if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) { 76 76 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); -
trunk/Ohana/src/photdbc/src/copy_images.c
r38986 r42389 58 58 59 59 char mapfile[DVO_MAX_PATH]; 60 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);60 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 61 61 AstromOffsetTable *table_src = AstromOffsetMapLoad (mapfile, 100000, VERBOSE); 62 62 … … 77 77 AstromOffsetTableAddMapFromImage (table_tgt, &subset[i]); 78 78 } 79 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", outdir);79 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", outdir); 80 80 AstromOffsetMapSave (table_tgt, mapfile); 81 81 free (table_tgt->imageIDtoTableSeq); -
trunk/Ohana/src/relastro/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/Ohana/src/relastro/src (added) merged: 42345,42361
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relastro/src/ConfigInit.c
r39926 r42389 61 61 ScanConfig(config, "WHERE_B", "%s", 0, WHERE_B); 62 62 63 snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR);63 snprintf_nowarn (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR); 64 64 65 65 if (!ScanConfig (config, "SKY_DEPTH", "%d", 0, &SKY_DEPTH)) SKY_DEPTH = 2; … … 77 77 78 78 /* update master photcode table if not defined */ 79 snprintf (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR);79 snprintf_nowarn (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR); 80 80 if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) { 81 81 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); -
trunk/Ohana/src/relastro/src/FrameCorrection.c
r38986 r42389 80 80 static int version = 0; 81 81 char filename[1024]; 82 snprintf (filename, 1024, "%s/frame.%03d.corr.fits", CATDIR, version);82 snprintf_nowarn (filename, 1024, "%s/frame.%03d.corr.fits", CATDIR, version); 83 83 FrameCorrectionSetSave (filename, set); 84 84 version ++; … … 217 217 static int version = 0; 218 218 char filename[1024]; 219 snprintf (filename, 1024, "%s/sh.%02d.dat", CATDIR, version);219 snprintf_nowarn (filename, 1024, "%s/sh.%02d.dat", CATDIR, version); 220 220 FILE *f = fopen (filename, "w"); 221 221 myAssert (f, "oops"); … … 519 519 static int version = 0; 520 520 char filename[1024]; 521 snprintf (filename, 1024, "%s/map.%02d.dat", CATDIR, version);521 snprintf_nowarn (filename, 1024, "%s/map.%02d.dat", CATDIR, version); 522 522 FILE *f = fopen (filename, "w"); 523 523 version ++; -
trunk/Ohana/src/relastro/src/ICRF.c
r39375 r42389 56 56 57 57 char filename[1024]; 58 snprintf (filename, 1024, "%s/test.icrf.dat", CATDIR);58 snprintf_nowarn (filename, 1024, "%s/test.icrf.dat", CATDIR); 59 59 FILE *f = fopen (filename, "w"); 60 60 -
trunk/Ohana/src/relastro/src/assign_images.c
r39926 r42389 25 25 26 26 char mapfile[DVO_MAX_PATH]; 27 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);27 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 28 28 AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE); 29 29 -
trunk/Ohana/src/relastro/src/bcatalog.c
r39995 r42389 64 64 if (VERBOSE2 && ExcludeBogus && (fbogus == NULL)) { 65 65 char name[1024]; 66 snprintf (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID);66 snprintf_nowarn (name, 1024, "%s/bogus.%02d.dat", CATDIR, HOST_ID); 67 67 fbogus = fopen (name, "w"); 68 68 if (!fbogus) { … … 533 533 if (dumpit) { 534 534 char name[64]; 535 snprintf (name, 64, "cat.%05d.dump.dat", oldcatalog[0].catID);535 snprintf_nowarn (name, 64, "cat.%05d.dump.dat", oldcatalog[0].catID); 536 536 FILE *fdump = fopen (name, "w"); 537 537 for (i = 0; i < Nkeep; i++) { -
trunk/Ohana/src/relastro/src/launch_region_hosts.c
r40415 r42389 63 63 // subset images per host : CATDIR/Image.HOSTNAME.fits 64 64 char filename[1024]; 65 snprintf (filename, 1024, "%s/Image.%d.fits", CATDIR, host->hostID);65 snprintf_nowarn (filename, 1024, "%s/Image.%d.fits", CATDIR, host->hostID); 66 66 if (unlink (filename)) fprintf (stderr, "trouble clearing image %s\n", filename); 67 67 … … 71 71 if (host->astromTable) { 72 72 char mapname[1024]; 73 snprintf (mapname, 1024, "%s/AstroMap.%d.fits", CATDIR, host->hostID);73 snprintf_nowarn (mapname, 1024, "%s/AstroMap.%d.fits", CATDIR, host->hostID); 74 74 75 75 // write the image subset for this host -
trunk/Ohana/src/relastro/src/load_images.c
r39926 r42389 56 56 57 57 char mapfile[DVO_MAX_PATH]; 58 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);58 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 59 59 table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE); 60 60 … … 96 96 97 97 char mapfile[DVO_MAX_PATH]; 98 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);98 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR); 99 99 AstromOffsetMapSave (table, mapfile); 100 100 -
trunk/Ohana/src/relastro/src/relastro_parallel_images.c
r40415 r42389 43 43 44 44 char mapfile[DVO_MAX_PATH]; 45 snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.%d.fits", CATDIR, REGION_HOST_ID);45 snprintf_nowarn (mapfile, DVO_MAX_PATH, "%s/AstroMap.%d.fits", CATDIR, REGION_HOST_ID); 46 46 AstromOffsetTable *table = AstromOffsetMapLoad (mapfile, 100000, VERBOSE); 47 47 -
trunk/Ohana/src/relastro/src/share_images_pos.c
r39457 r42389 38 38 if (table) { 39 39 char mapname[1024]; 40 snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, REGION_HOST_ID);40 snprintf_nowarn (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, REGION_HOST_ID); 41 41 42 42 // write the image subset for this host … … 113 113 114 114 char mapname[1024]; 115 snprintf (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID);115 snprintf_nowarn (mapname, 1024, "%s/AstroMapUpdate.%d.fits", CATDIR, regionHosts->hosts[i].hostID); 116 116 117 117 AstromOffsetTable *table = AstromOffsetMapLoad (mapname, 100000, VERBOSE); -
trunk/Ohana/src/relphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20220316/Ohana/src/relphot (added) merged: 42166,42267,42345,42361
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot/include/relphot.h
r42135 r42389 470 470 int PRESERVE_PS1; 471 471 int REQUIRE_PSFFIT; 472 int USE_APER_FOR_STARGAL; 472 473 int UPDATE; 473 474 int SAVE_IMAGE_UPDATES; -
trunk/Ohana/src/relphot/src/args.c
r42135 r42389 247 247 REQUIRE_PSFFIT = TRUE; 248 248 } 249 USE_APER_FOR_STARGAL = FALSE; 250 if ((N = get_argument (argc, argv, "-use-aper-for-stargal"))) { 251 remove_argument (N, &argc, argv); 252 USE_APER_FOR_STARGAL = TRUE; 253 } 249 254 250 255 UPDATE = FALSE; -
trunk/Ohana/src/relphot/src/bcatalog.c
r41647 r42389 82 82 if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { Ndophot ++; continue; } 83 83 84 float Maper = USE_APER_FOR_STARGAL ? catalog[0].measure[offset].Map : catalog[0].measure[offset].Mkron; 85 84 86 // skip garbage measurements 85 87 if (isnan(catalog[0].measure[offset].psfQF) || (catalog[0].measure[offset].psfQF < 0.95)) { Npsfqf ++; continue; } 86 88 if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < 0.95)) { Npsfqf ++; continue; } 87 89 if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; } 88 if (isnan( catalog[0].measure[offset].Mkron)) { Nnan ++; continue; }90 if (isnan(Maper)) { Nnan ++; continue; } 89 91 90 92 // require 0x01 in photFlags (fitted with a PSF) -- add to the test data 91 93 if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; } 92 94 93 // very loose cut on PSF - Kron94 float Mkp = catalog[0].measure[offset].M - catalog[0].measure[offset].Mkron;95 // very loose cut on PSF - APER mag (Map or Mkron) -- this lightly rejects galaxies & other oddities 96 float Mkp = catalog[0].measure[offset].M - Maper; 95 97 if (fabs(Mkp) > 1.0) { Nbad ++; continue; } 96 98 … … 101 103 if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;} 102 104 103 // check for galaxies (XXX skip for now) 104 if (FALSE && !isnan(catalog[0].measure[offset].Map)) { 105 if (catalog[0].measure[offset].M - catalog[0].measure[offset].Map > 0.15) { 106 nEXT ++; 107 } else { 108 nPSF ++; 109 } 105 // weak test for galaxies 106 if (Mkp > 0.5) { 107 nEXT ++; 108 } else { 109 nPSF ++; 110 110 } 111 111 … … 145 145 146 146 // skip object if it is likely to be a galaxy 147 if ( FALSE && (nEXT >= nPSF)) {147 if (nEXT >= nPSF) { 148 148 Nmeasure -= Nm; 149 149 Ngalaxy ++; -
trunk/Ohana/src/relphot/src/save_images.c
r41556 r42389 19 19 20 20 char filename[1024]; 21 snprintf (filename, 1024, "%s.bck", ImageCat); // ImageCat is global21 snprintf_nowarn (filename, 1024, "%s.bck", ImageCat); // ImageCat is global 22 22 if (!gfits_db_lock (&dbX, filename)) { 23 23 fprintf (stderr, "can't lock backup image image catalog\n"); … … 85 85 dbX.format = db->format; 86 86 87 snprintf (filename, 1024, "%s.bck", ImageCat);87 snprintf_nowarn (filename, 1024, "%s.bck", ImageCat); 88 88 if (!gfits_db_lock (&dbX, filename)) { 89 89 fprintf (stderr, "can't lock backup image image catalog\n"); -
trunk/Ohana/src/tools/src/findexec.c
r12333 r42389 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, ':'); -
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)) { -
trunk/Ohana/src/tools/src/fits_to_mysql.c
r39093 r42389 252 252 253 253 char field[256], tlabel[256], format[256]; 254 snprintf (field, 256, "TTYPE%d", i+1);254 snprintf_nowarn (field, 256, "TTYPE%d", i+1); 255 255 gfits_scan (header, field, "%s", 1, tlabel); 256 256 257 snprintf (field, 256, "TFORM%d", i+1);257 snprintf_nowarn (field, 256, "TFORM%d", i+1); 258 258 gfits_scan (header, field, "%s", 1, format); 259 259 … … 270 270 if (Ndup) { 271 271 char tmpname[256]; 272 snprintf (tmpname, 256, "%s_%d", tlabel, Ndup);272 snprintf_nowarn (tmpname, 256, "%s_%d", tlabel, Ndup); 273 273 column[Ncolumn].colname = strcreate (tmpname); 274 274 } else { … … 357 357 char colname[64]; 358 358 for (j = 0; j < Nval; j++) { 359 snprintf (colname, 64, "%s_%d", rootname, j + 1);359 snprintf_nowarn (colname, 64, "%s_%d", rootname, j + 1); 360 360 PrintIOBuffer (buffer, "%s %s", colname, typename); 361 361 if (j < Nval - 1) { … … 455 455 char colname[64]; 456 456 for (j = 0; j < columns[i].Nval; j++) { 457 snprintf (colname, 64, "%s_%d", columns[i].colname, j + 1);457 snprintf_nowarn (colname, 64, "%s_%d", columns[i].colname, j + 1); 458 458 PrintIOBuffer (insert, "%s", colname); 459 459 if (j < columns[i].Nval - 1) { … … 649 649 650 650 /* get column keywords */ 651 snprintf (field, 256, "TTYPE%d", Nfield);651 snprintf_nowarn (field, 256, "TTYPE%d", Nfield); 652 652 gfits_scan (header, field, "%s", 1, tlabel); 653 snprintf (field, 256, "TSCAL%d", Nfield);653 snprintf_nowarn (field, 256, "TSCAL%d", Nfield); 654 654 gfits_scan (header, field, "%lf", 1, &Bscale); 655 snprintf (field, 256, "TZERO%d", Nfield);655 snprintf_nowarn (field, 256, "TZERO%d", Nfield); 656 656 gfits_scan (header, field, "%lf", 1, &Bzero); 657 snprintf (field, 256, "TFORM%d", Nfield);657 snprintf_nowarn (field, 256, "TFORM%d", Nfield); 658 658 gfits_scan (header, field, "%s", 1, format); 659 659 … … 669 669 int Nstart = 0; 670 670 for (i = 1; i < Nfield; i++) { 671 snprintf (field, 256, "TFORM%d", i);671 snprintf_nowarn (field, 256, "TFORM%d", i); 672 672 gfits_scan (header, field, "%s", 1, format); 673 673 int Nv, Nb; -
trunk/Ohana/src/tools/src/mpcorb_predict.c
r42076 r42389 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; -
trunk/Ohana/src/tools/src/mpcorb_predict_tests.c
r41713 r42389 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); -
trunk/Ohana/src/uniphot/src/ConfigInit.c
r33654 r42389 22 22 ScanConfig (config, "CATFORMAT", "%s", 0, CATFORMAT); 23 23 24 s printf (ImageCat, "%s/Images.dat", CATDIR);24 snprintf_nowarn (ImageCat, 256, "%s/Images.dat", CATDIR); 25 25 26 26 GetConfig (config, "GSCFILE", "%s", 0, GSCFILE); -
trunk/Ohana/src/uniphot/src/load_zpt_table.c
r40549 r42389 323 323 // photcode name 324 324 char photname[64]; 325 snprintf (photname, 64, "GPC1.%s.XY%d%d", filter, ix, iy);325 snprintf_nowarn (photname, 64, "GPC1.%s.XY%d%d", filter, ix, iy); 326 326 // note that the XY00, XY07, etc, chips will have photcode values of 0 327 327
Note:
See TracChangeset
for help on using the changeset viewer.
