Skip to content

Terminator error in string parsing #2

@GioCC

Description

@GioCC

[TO BE VERIFIED]
In the XPLPro::_parseXxx() methods, the parameter parsing seems to be incorrect:
current is

    for (int i = 1; i < parameter; i++) {
        while (inBuffer[pos] != ',' && inBuffer[pos] != 0) {
            pos++;
        }
        pos++;  // skip terminator, position pointer at the start of next parameter
    }

but the terminator is skipped as if it were a separator, taking the pointer beyond it where it may not find another termination.
This should be correct:

   for (int i = 1; i < parameter; i++) {
       while (inBuffer[pos] != ',' && inBuffer[pos] != 0) {
           pos++;
       }
       if(inBuffer[pos] != 0) pos++;  // skip terminator, position pointer at the start of next parameter
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions