Resolve #57: SCPI_ExprChannelListEntry() crashes with whitespaces
| | |
| | | if (res == SCPI_EXPR_ERROR) { |
| | | SCPI_ErrorPush(context, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | } |
| | | if (res == SCPI_EXPR_NO_MORE) { |
| | | if (!scpiLex_IsEos(&lex)) { |
| | | res = SCPI_EXPR_ERROR; |
| | | SCPI_ErrorPush(context, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | |
| | | TEST_ChannelList("(@1,2!5:3!6!7)", 0, 2, FALSE, 1, (1), (0), SCPI_EXPR_OK, 0); |
| | | TEST_ChannelList("(@1,2!5:3!6!7)", 1, 2, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | TEST_ChannelList("(@1,2!5:3!6!7)", 2, 2, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | |
| | | TEST_ChannelList("(@1, 2)", 0, 1, FALSE, 1, (1), (0), SCPI_EXPR_OK, 0); |
| | | TEST_ChannelList("(@1, 2)", 1, 1, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR); |
| | | } |
| | | |
| | | int main() { |