IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2018, 8:58:31 PM (8 years ago)
Author:
eugene
Message:

add snprintf_nowarn function to avoid compiler warnings from desired snprint truncations

Location:
trunk/Ohana/src/opihi
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/module.c

    r12332 r40549  
    2323  /* search for requested file in MODULES:0 - MODULES:n */
    2424  for (i = 0; i < Nmodules; i++) {
    25     snprintf (modname, 16, "MODULES:%d", i);
     25    snprintf_nowarn (modname, 16, "MODULES:%d", i);
    2626    modpath = get_variable (modname);
    2727    if (modpath == NULL) {
  • trunk/Ohana/src/opihi/cmd.data/imspline_apply.c

    r34584 r40549  
    4747  gfits_create_matrix (&out[0].header, &out[0].matrix);
    4848  if ((y1[0].file[0] != '*') && (y1[0].file[0] != '(')) {
    49     sprintf (out[0].file, "*%s", y1[0].file);
     49    snprintf_nowarn (out[0].file, OPIHI_NAME_SIZE, "*%s", y1[0].file);
    5050  } else {
    51     sprintf (out[0].file, "%s", y1[0].file);
     51    snprintf_nowarn (out[0].file, OPIHI_NAME_SIZE, "%s", y1[0].file);
    5252  }
    5353
  • trunk/Ohana/src/opihi/cmd.data/imspline_construct.c

    r34584 r40549  
    1919  free (out[0].matrix.buffer);
    2020  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
    21     sprintf (out[0].file, "*%s", in[0].file);
     21    snprintf_nowarn (out[0].file, OPIHI_NAME_SIZE, "*%s", in[0].file);
    2222  } else {
    23     sprintf (out[0].file, "%s", in[0].file);
     23    snprintf_nowarn (out[0].file, OPIHI_NAME_SIZE, "%s", in[0].file);
    2424  }
    2525  out[0].bitpix = in[0].bitpix;
  • trunk/Ohana/src/opihi/dvo/dvo_host_utils.c

    r40408 r40549  
    1313  int TIME = time(NULL);
    1414  int PID = getpid();
    15   snprintf (uniquer, 12, "%05d.%05d", PID, TIME % 100000);
     15  snprintf_nowarn (uniquer, 12, "%05d.%05d", PID, TIME % 100000);
    1616
    1717  // write the dvo comment (host independent)
Note: See TracChangeset for help on using the changeset viewer.