- if (isdigit(*linep) || *linep=='+' || *linep=='-' || *linep=='.') {
- // treat as a number
- i = 0;
- if (sscanf(linep, "%lf%n", &aaitem, &i) < 1) {
- linep = line; // Invalid numbers are ignored
- *linep = 0;
- return IHEOL;
- }
- else {
- // skip to end
- linep += i;
- return IHREAL;
- }
+ i = 0;
+ // try a number
+ if (sscanf(linep, "%lf%n", &aaitem, &i) > 0) {
+ // skip to end
+ linep += i;
+ return IHREAL;