mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
Need to cover zero token case (Shakers)
Previous fix to#63 didn't cover case where there are no tokens left because skini messages provides all values. For example, changing a shaker instrument has no further tokens, but rather pulls two constants directly from skini_msgs[]. Changed test ca line161 to bail out when more tokens are expected and none are left: when data type is SK_INT, SK_DBL or SK_STR (all less than 0)
This commit is contained in:
@@ -158,7 +158,8 @@ long Skini :: parseString( std::string& line, Message& message )
|
||||
while ( dataType != NOPE ) {
|
||||
|
||||
// if ( tokens.size() <= (unsigned int) (iValue+3) ) { //rgh: test iToken rather than always testing iValue+3
|
||||
if (tokens.size() <= iToken) {
|
||||
// if (tokens.size() <= iToken) { //rgh: iToken only tests it more tokens are to be consumed (SK_INT, SK_DBL, SK_STR)
|
||||
if ((tokens.size() <= iToken) && (dataType < 0)) { //Don't fail if remaining iValues come from skini_msgs[] rather than tokens[].
|
||||
oStream_ << "Skini::parseString: inconsistency between type table and parsed line:\n " << line;
|
||||
handleError( StkError::WARNING );
|
||||
return message.type = 0;
|
||||
|
||||
Reference in New Issue
Block a user