add the case insensitive check for the poly token

to function interpretpoly()
This commit is contained in:
Holger Vogt 2018-07-13 22:46:51 +02:00
parent e94fdd0fbe
commit 8c96344015
1 changed files with 6 additions and 6 deletions

View File

@ -109,15 +109,15 @@ Poly_t interpretpoly(struct card *input, char controlType, char sourceType)
Poly.Coefficients = 0;
char * linestr;
linestr = input->line;
char * polystr;
polystr = strstr(linestr, "poly(");
if(polystr == NULL) {
return Poly;
}
char * polystr = linestr;
/* skip the first three tokens */
polystr = nexttok(polystr);
polystr = nexttok(polystr);
polystr = nexttok(polystr);
int charsAfterPoly = 0;
sscanf(polystr, "poly( %u )%n", &Poly.Dimensions, &charsAfterPoly);
if(Poly.Dimensions == 0) {
fprintf(stderr, "ERROR: POLY interpreted as having 0 dimensions, Syntax Error Assumed.");
fprintf(stderr, "ERROR: POLY interpreted as having 0 dimensions, Syntax Error Assumed.\n");
controlled_exit(EXIT_BAD);
}
Poly.ExpressionList = (char **) tmalloc(Poly.Dimensions * sizeof(char *));