Conform to coding standard and errors

An error will not be printed if the parameter to `T` is not valid (- or
a number) and the token will be eaten (just like when an invalid
attribute is found)
This commit is contained in:
Jesper Jensen 2015-07-22 22:46:30 +02:00
parent 49fdc25f37
commit 73d8c58286

View File

@ -540,11 +540,11 @@ parse (char *text)
break;
case 'T':
if(*p == '-') { //Reset to automatic font selection
if (*p == '-') { //Reset to automatic font selection
font_index = -1;
p++;
break;
}
} else if (isdigit(*p)) {
font_index = (int)strtoul(p, &ep, 10);
// User-specified 'font_index' ∊ (0,font_count]
// Otherwise just fallback to the automatic font selection
@ -552,6 +552,10 @@ parse (char *text)
font_index = -1;
p = ep;
break;
} else {
fprintf(stderr, "Invalid font slot \"%c\"\n", *p++); //Swallow the token
break;
}
// In case of error keep parsing after the closing }
default: