Changeset 38529
- Timestamp:
- Jun 24, 2015, 7:00:04 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src
- Files:
-
- 4 edited
-
dvoverify.c (modified) (3 diffs)
-
dvoverify_args.c (modified) (1 diff)
-
dvoverify_catalogs.c (modified) (6 diffs)
-
dvoverify_utils.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvoverify.c
r34405 r38529 24 24 25 25 // check the photcode table 26 sprintf (filename, "%s/Photcodes.dat", CATDIR);26 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR) < DVO_MAX_PATH, "overflow"); 27 27 if (!VerifyTableFile (filename)) { 28 28 Nbad ++; … … 34 34 Nbad ++; 35 35 } 36 free (skyfile); 36 37 37 38 // check the image table 38 sprintf (filename, "%s/Images.dat", CATDIR);39 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/Images.dat", CATDIR) < DVO_MAX_PATH, "overflow"); 39 40 if (!VerifyTableFile (filename)) { 40 41 Nbad ++; … … 71 72 fprintf (stderr, "NOTE: %d files are not sorted\n", NNotSorted); 72 73 } 74 75 FreeImageIDs (); 76 FreeFailures (); 77 SkyTableFree (sky); 78 SkyListFree (skylist); 79 80 ohana_memcheck (TRUE); 81 ohana_memdump (TRUE); 73 82 exit (0); 74 83 } -
branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvoverify_args.c
r37360 r38529 45 45 } 46 46 47 CHECK_IMAGE_ID = FALSE; 48 47 49 int isGood = dvoverify_single (filename); 50 free (filename); 51 52 ohana_memcheck (TRUE); 53 ohana_memdump (TRUE); 54 48 55 if (!isGood) exit (1); 49 56 exit (0); -
branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvoverify_catalogs.c
r37360 r38529 27 27 if (!HostTableTestHost(skylist[0].regions[i], HOST_ID)) continue; 28 28 29 sprintf (filename, "%s/%s.cpt", mycatdir, skylist[0].regions[i][0].name);29 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cpt", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 30 30 if (!VerifyTableFile (filename)) { 31 31 Nbad ++; … … 34 34 } 35 35 36 sprintf (filename, "%s/%s.cps", mycatdir, skylist[0].regions[i][0].name);36 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cps", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 37 37 if (!VerifyTableFile (filename)) { 38 38 Nbad ++; … … 40 40 } 41 41 42 sprintf (filename, "%s/%s.cpm", mycatdir, skylist[0].regions[i][0].name);42 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cpm", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 43 43 if (!VerifyTableFile (filename)) { 44 44 Nbad ++; … … 47 47 } 48 48 49 sprintf (filename, "%s/%s.cpx", mycatdir, skylist[0].regions[i][0].name);49 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cpx", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 50 50 if (!VerifyTableFile (filename)) { 51 51 Nbad ++; … … 54 54 } 55 55 56 sprintf (filename, "%s/%s.cpy", mycatdir, skylist[0].regions[i][0].name);56 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cpy", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 57 57 if (!VerifyTableFile (filename)) { 58 58 Nbad ++; … … 61 61 } 62 62 63 sprintf (filename, "%s/%s.cpt", mycatdir, skylist[0].regions[i][0].name);63 myAssert (snprintf (filename, DVO_MAX_PATH, "%s/%s.cpt", mycatdir, skylist[0].regions[i][0].name) < DVO_MAX_PATH, "overflow"); 64 64 if (!skipIndexCheck) { 65 65 if (!CheckCatalogIndexes(filename, skylist[0].regions[i])){ -
branches/eam_branches/ipp-20150616/Ohana/src/dvomerge/src/dvoverify_utils.c
r38471 r38529 5 5 static char **failures = NULL; 6 6 7 void InitFailures () { 8 ALLOCATE (failures, char *, NFAILURES); 7 void InitFailures (void) { 8 ALLOCATE_ZERO (failures, char *, NFAILURES); 9 } 10 11 void FreeFailures (void) { 12 int i; 13 14 if (!failures) return; 15 for (i = 0; i < NFAILURES; i++) { 16 FREE (failures[i]); 17 } 18 FREE (failures); 9 19 } 10 20 … … 128 138 fprintf (stderr, "unable to read header for %s, extension %d (or file has excess bytes)\n", filename, Next); 129 139 } 130 fclose(file); 140 fclose (file); 141 gfits_free_header (&header); 131 142 return (FALSE); 132 143 } … … 175 186 176 187 // set the parameters which guide catalog open/load/create 177 dvo_catalog_init (&catalog, TRUE);188 dvo_catalog_init (&catalog, TRUE); 178 189 catalog.filename = filename; 179 190 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ; … … 183 194 if (!dvo_catalog_open (&catalog, region, VERBOSE, "r")) { 184 195 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 196 dvo_catalog_free (&catalog); 185 197 return FALSE; 186 198 } … … 463 475 464 476 char ImageCat[DVO_MAX_PATH]; 465 snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", catdir);477 myAssert (snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", catdir) < DVO_MAX_PATH, "overflow"); 466 478 467 479 // load the iage database table … … 506 518 IDlist[id] = i; 507 519 } 508 509 // free image table here? 520 510 521 // (in the future, I'll have to do the image table read in segments 511 522 // it is just getting to be too large...) 512 523 dvo_image_unlock (&inDB); // unlock input 524 gfits_db_free (&inDB); 513 525 514 526 return TRUE; 527 } 528 529 void FreeImageIDs (void) { 530 FREE (IDlist); 515 531 } 516 532
Note:
See TracChangeset
for help on using the changeset viewer.
