IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2023, 12:17:35 PM (3 years ago)
Author:
eugene
Message:

merge from eam_branches/ipp-20220316. fixes for more pendantic gcc; add opihi memory stats; string vector improvements; use named macros for fixed string lengths

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/imregister/base/ConfigInit.c

    r25757 r42389  
    66
    77  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];
    1111
    1212  /*** load configuration info ***/
     
    2828  WarnConfig (config, "CATDIR",                      "%s", 0, catdir);
    2929  WarnConfig (config, "PHOTCODE_FILE",               "%s", 0, MasterPhotcodeFile);
    30   sprintf (ImPhotDB, "%s/Images.dat", catdir);
     30  snprintf_nowarn (ImPhotDB, MY_MAX_PATH, "%s/Images.dat", catdir);
    3131
    3232  /* small text databases: filters, camera defs */
     
    7575                                                   
    7676  WarnConfig (config, "imstats",                     "%s", 0, ElixirBase);
    77   sprintf (ImstatFifo, "%s.photcode", ElixirBase);   
     77  snprintf_nowarn (ImstatFifo, MY_MAX_PATH, "%s.photcode", ElixirBase);   
    7878  WarnConfig (config, "ptolemy",                     "%s", 0, ElixirBase);
    79   sprintf (PtolemyFifo, "%s.photcode", ElixirBase);
     79  snprintf_nowarn (PtolemyFifo, MY_MAX_PATH, "%s.photcode", ElixirBase);
    8080
    8181  if (!ScanConfig (config, "CONNECT", "%s",  0, CONNECT)) {
    82     sprintf (CONNECT, "/usr/bin/rsh");
     82    snprintf_nowarn (CONNECT, 64, "/usr/bin/rsh");
    8383  }
    8484
     
    8787  NDetrendAltDB = 0;
    8888  ALLOCATE (DetrendAltDB, char *, NDB);
    89   ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);
     89  ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH);
    9090  for (i = 1; ScanConfig (config, "DETREND_ALT_DB", "%s", i, DetrendAltDB[NDetrendAltDB]); i++) {
    9191    NDetrendAltDB ++;
     
    9494      REALLOCATE (DetrendAltDB, char *, NDB);
    9595    }
    96     ALLOCATE (DetrendAltDB[NDetrendAltDB], char, 256);
     96    ALLOCATE (DetrendAltDB[NDetrendAltDB], char, MY_MAX_PATH);
    9797  }
    9898  free (DetrendAltDB[NDetrendAltDB]);
     
    104104
    105105  /* XXX this does not yet write out the master photcode table */
    106   sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", catdir);
     106  snprintf_nowarn (CatdirPhotcodeFile, MY_MAX_PATH, "%s/Photcodes.dat", catdir);
    107107  if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile, TRUE)) {
    108108    fprintf (stderr, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
Note: See TracChangeset for help on using the changeset viewer.