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/opihi/dvo/elixir.c

    r27611 r42389  
    44int ReadMsg (char *fifo, char **message);
    55
     6# define MY_MAX_PATH 256
     7
    68int elixir (int argc, char **argv) {
    79 
    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];
    1012  char *answer;
    1113  int N;
     
    3840    return (FALSE);
    3941  }
    40   sprintf (fifo, "%s.msg", ElixirBase);
     42  snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase);
    4143  if (!VarConfig ("FIFOS", "%s", fifodir)) {
    4244    gprint (GP_ERR, "FIFOS not in config, using local /tmp\n");
    4345    strcpy (fifodir, "/tmp");
    4446  }
    45   sprintf (fifo, "%s.msg", ElixirBase);
     47  snprintf_nowarn (fifo, MY_MAX_PATH, "%s.msg", ElixirBase);
    4648
    47   sprintf (msgfile, "%s/EMsg.XXXXXX", fifodir);
     49  snprintf_nowarn (msgfile, MY_MAX_PATH, "%s/EMsg.XXXXXX", fifodir);
    4850  if (mkstemp (msgfile) == -1) {
    4951    gprint (GP_ERR, "can't create fifo\n");
    5052    return (FALSE);
    5153  }
    52   sprintf (message, "%s %s", cmd, msgfile);
     54  snprintf_nowarn (message, MY_MAX_PATH, "%s %s", cmd, msgfile);
    5355  unlink (msgfile);
    5456
Note: See TracChangeset for help on using the changeset viewer.