IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14179


Ignore:
Timestamp:
Jul 12, 2007, 2:27:26 PM (19 years ago)
Author:
eugene
Message:

error if N < 1

File:
1 edited

Legend:

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

    r7917 r14179  
    2323  ALLOCATE (line, char, 1024);
    2424  N = 1;
    25   if (argc == 4)
     25  if (argc == 4) {
    2626    N = atof(argv[3]);
     27    if (N < 1) {
     28      gprint (GP_ERR, "scan: line numbers must start at 1\n");
     29      return (FALSE);
     30    }
     31  }
    2732
    2833  for (i = 0; (i < N) && ((status = scan_line (f, line)) != EOF); i++);
Note: See TracChangeset for help on using the changeset viewer.