GithubHelp home page GithubHelp logo

Comments (4)

j123b567 avatar j123b567 commented on May 30, 2024

Can you please show me some example, how to reproduce this error? Example scpi command with parameters and how you handle it.

from scpi-parser.

mk-at-sch avatar mk-at-sch commented on May 30, 2024

Perhaps it's due to the old code base. This function was unchanged since then, but perhaps the handling of remaining bytes after processing the expected parameters was modified.
I could reproduce this by using the SCPI_ParamText function with a text in "".
I just found out that locateText is tested isolated but there is no test for SCPI_ParamText (TODO flag), am I correct?
If you add a sample command expecting one text parameter and test it with a text w/o and w/ "" then an error should be produced for the test in "".

My handling in the called function is just

// Read string
if(SCPI_ParamText(context, &cStrPtr, &len, FALSE)) {
    if(len > XY_STRINGSIZE - 1) {
        SCPI_ErrorPush(context, SCPI_ERROR_DATA_OUTOFRANGE);
        return SCPI_RES_ERR;
    }
}

from scpi-parser.

j123b567 avatar j123b567 commented on May 30, 2024

OK, there is no longer function SCPI_ParamText, because it does not work as expected. If you don't care about " or ' inside of the string, you can now use SCPI_ParamCharacters. If you care, you must use SCPI_ParamCopyText. Both functions work properly and they are also well tested in test_parser.c.

If you have same problems with newest version, just open new issue, but I must close this as invalid, because it is no longer true.

from scpi-parser.

mk-at-sch avatar mk-at-sch commented on May 30, 2024

You are correct - sorry for that. I mixed up different sources. My fault.
Thanks for the hint.

from scpi-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.