IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2010, 3:47:36 PM (16 years ago)
Author:
eugene
Message:

pendatic checking fscan, system, and mkstemp return values

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

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/flux.c

    r7917 r27611  
    2929  ymax = 0;
    3030  for (i = 0; i < 4; i++) {
    31     fscanf (f, "%lf %lf", &x[i], &y[i]);
     31    if (fscanf (f, "%lf %lf", &x[i], &y[i]) != 2) {
     32      fprintf (stderr, "error reading coordinates from %s\n", argv[2]);
     33      fclose (f);
     34      return (FALSE);
     35    }
    3236    xmin = MAX (0, MIN (xmin, x[i] - 1));
    3337    ymin = MAX (0, MIN (ymin, y[i] - 1));
  • trunk/Ohana/src/opihi/cmd.basic/help.c

    r11084 r27611  
    1515  if (argc == 1) {
    1616    sprintf (buff, "ls %s", helpdir);
    17     system (buff);
     17    if (system (buff) == -1) {
     18      fprintf (stderr, "help directory unavailable\n");
     19      return (FALSE);
     20    }
    1821    return (TRUE);
    1922  }
  • trunk/Ohana/src/opihi/cmd.basic/list_help.c

    r7917 r27611  
    1818    fclose (f);
    1919    sprintf (line, "more %s", filename);
    20     system (line);
     20    if (system (line) == -1) {
     21      fprintf (stderr, "help list unavailable\n");
     22    }
    2123  }
    2224  unlink (filename);
  • trunk/Ohana/src/opihi/cmd.data/queuedrop.c

    r8427 r27611  
    44 
    55  int N;
    6   char *Key;
    7   char *line;
    8   char *Value;
    9   Queue *queue;
     6  char *Key = NULL;
     7  char *line = NULL;
     8  Queue *queue = NULL;
     9  char *Value = NULL;
    1010
    1111  Key = NULL;
  • trunk/Ohana/src/opihi/dvo/elixir.c

    r27435 r27611  
    4646
    4747  sprintf (msgfile, "%s/EMsg.XXXXXX", fifodir);
    48   mkstemp (msgfile);
     48  if (mkstemp (msgfile) == -1) {
     49    gprint (GP_ERR, "can't create fifo\n");
     50    return (FALSE);
     51  }
    4952  sprintf (message, "%s %s", cmd, msgfile);
    5053  unlink (msgfile);
  • trunk/Ohana/src/opihi/lib.shell/interrupt.c

    r14284 r27611  
    2727  while (1) {
    2828    gprint (GP_ERR, "operation halted, continue? (y/n) ");
    29     fscanf (stdin, "%s", string);
     29    if (fscanf (stdin, "%s", string) != 1) fprintf (stderr, "what?\n");
    3030   
    3131    if ((string[0] == 'y') || (string[0] == 'Y')) {
Note: See TracChangeset for help on using the changeset viewer.