{"action":"created","issue":{"url":"https://api.github.com/repos/j123b567/scpi-parser/issues/42","labels_url":"https://api.github.com/repos/j123b567/scpi-parser/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/j123b567/scpi-parser/issues/42/comments","events_url":"https://api.github.com/repos/j123b567/scpi-parser/issues/42/events","html_url":"https://github.com/j123b567/scpi-parser/issues/42","id":103475176,"number":42,"title":"SCPI_ParamText() does not correct the paramlist.length if text is \"-capsulated","user":{"login":"mk-at-sch","id":13996748,"avatar_url":"https://avatars.githubusercontent.com/u/13996748?v=3","gravatar_id":"","url":"https://api.github.com/users/mk-at-sch","html_url":"https://github.com/mk-at-sch","followers_url":"https://api.github.com/users/mk-at-sch/followers","following_url":"https://api.github.com/users/mk-at-sch/following{/other_user}","gists_url":"https://api.github.com/users/mk-at-sch/gists{/gist_id}","starred_url":"https://api.github.com/users/mk-at-sch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mk-at-sch/subscriptions","organizations_url":"https://api.github.com/users/mk-at-sch/orgs","repos_url":"https://api.github.com/users/mk-at-sch/repos","events_url":"https://api.github.com/users/mk-at-sch/events{/privacy}","received_events_url":"https://api.github.com/users/mk-at-sch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/j123b567/scpi-parser/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/j123b567/scpi-parser/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-27T10:21:51Z","updated_at":"2015-08-27T16:05:52Z","closed_at":null,"body":"Not correcting the length will result in \"Parameter not allowed error\" (more parameters than allowed) - but I'm not on the current code base...\r\nThe text parsing is correct, but the tests do not check for the length (== 0) after processing, correct?\r\n\r\nI did a quick fix for my needs to detect the \"\" and correct the length:\r\n```c\r\n// ...\r\nif (locateText(context->paramlist.parameters, \r\n            context->paramlist.length, value, &length)) {\r\n    *// Work-around: Correct paramlist.length\r\n    if(*context->paramlist.parameters == '\"')\r\n        paramSkipBytes(context, 2);\r\n\r\n    paramSkipBytes(context, length);\r\n    if (len) {\r\n        *len = length;\r\n    }\r\n    return TRUE;\r\n}\r\n```\r\nThanks."},"comment":{"url":"https://api.github.com/repos/j123b567/scpi-parser/issues/comments/135479423","html_url":"https://github.com/j123b567/scpi-parser/issues/42#issuecomment-135479423","issue_url":"https://api.github.com/repos/j123b567/scpi-parser/issues/42","id":135479423,"user":{"login":"mk-at-sch","id":13996748,"avatar_url":"https://avatars.githubusercontent.com/u/13996748?v=3","gravatar_id":"","url":"https://api.github.com/users/mk-at-sch","html_url":"https://github.com/mk-at-sch","followers_url":"https://api.github.com/users/mk-at-sch/followers","following_url":"https://api.github.com/users/mk-at-sch/following{/other_user}","gists_url":"https://api.github.com/users/mk-at-sch/gists{/gist_id}","starred_url":"https://api.github.com/users/mk-at-sch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mk-at-sch/subscriptions","organizations_url":"https://api.github.com/users/mk-at-sch/orgs","repos_url":"https://api.github.com/users/mk-at-sch/repos","events_url":"https://api.github.com/users/mk-at-sch/events{/privacy}","received_events_url":"https://api.github.com/users/mk-at-sch/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T16:05:52Z","updated_at":"2015-08-27T16:05:52Z","body":"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.\r\nI could reproduce this by using the SCPI_ParamText function with a text in \"\".\r\nI just found out that locateText is tested isolated but there is no test for SCPI_ParamText (TODO flag), am I correct?\r\nIf 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 \"\".\r\n\r\nMy handling in the called function is just \r\n```c\r\n// Read string\r\nif(SCPI_ParamText(context, &cStrPtr, &len, FALSE)) {\r\n    if(len > XY_STRINGSIZE - 1) {\r\n        SCPI_ErrorPush(context, SCPI_ERROR_DATA_OUTOFRANGE);\r\n        return SCPI_RES_ERR;\r\n    }\r\n}\r\n```"}}