Adding a fix to readNoteType so it properly advances the string when it didn't read a new command char and reruns the same command.

This commit is contained in:
Ilya Seletsky 2017-07-14 03:09:17 -07:00
parent 746767a62b
commit be0895c88b
1 changed files with 5 additions and 3 deletions

View File

@ -24,10 +24,12 @@ namespace msdfgen {
static bool readNodeType(char &output, const char *&pathDef) {
int shift;
char nodeType;
if (sscanf(pathDef, " %c%n", &nodeType, &shift) == 1 && nodeType != '+' && nodeType != '-' && nodeType != '.' && nodeType != ',' && (nodeType < '0' || nodeType > '9')) {
if (sscanf(pathDef, " %c%n", &nodeType, &shift) == 1) {
pathDef += shift;
output = nodeType;
return true;
if (nodeType != '+' && nodeType != '-' && nodeType != '.' && nodeType != ',' && (nodeType < '0' || nodeType > '9')) {
output = nodeType;
return true;
}
}
return false;
}