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:
rhenninger
2016-08-15 09:16:50 -04:00
committed by GitHub
parent fe0f5d7f96
commit ff52b9f0b0

View File

@@ -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;