IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42777


Ignore:
Timestamp:
Dec 29, 2024, 4:20:40 PM (19 months ago)
Author:
eugene
Message:

change assert to an error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-ppmerge-20241229/psModules/src/camera/pmFPAConstruct.c

    r42773 r42777  
    5252
    5353// Parse a list of first:second:third pairs in a string
     54// EAM : this function takes an input 'string' and attempts to parse out
     55// groups of the form FIRST:SECOND:THIRD into the arrays (first, second, third).
     56
     57// The input string may have multiple entries of this form separated by spaces, commas, or
     58// semi-colons.  The number of arrays which are supplied must match the string format or
     59// an error will be raised.
     60
     61// e.g., the string could be CHIP:CELL:TYPE in which case all three arrays must exist
     62// or, the string could be CHIP:CELL only, in which case the array 'third' must be NULL
     63 
    5464static int parseContent(psArray **first, // Array of the first values
    5565                         psArray **second, // Array of the second values
     
    8393    while ((value = psListGetAndIncrement(valuesIter))) {
    8494        psArray *fst = psStringSplitArray(value, ":", true); // First, second, third
    85         assert (numArrays == fst->n);
     95        if (fst->n != numArrays) {
     96          psError(PS_ERR_BAD_PARAMETER_VALUE, false, "string %s does not match expected format (%ld colon-separated items supplied, %d expected)", value, fst->n, numArrays);
     97          return 0;
     98        }
    8699        switch (numArrays) {
    87100          case 3:
Note: See TracChangeset for help on using the changeset viewer.