- for (int i = 0; i < NSPECIALS; ++i) {
- for (int j = 0; j < specials[i].words.n; ++j) {
- if (strncasecmp(word, specials[i].words.strs[j], TOKLEN) == 0)
- return (i);
- }
+ // Handle negative number
+ if (*str == '-')
+ ++str;
+
+ // Handle empty string or just "-". Should never reach this
+ // point, because this is only used with transitive verbs.
+ if (!*str)
+ return false; // LCOV_EXCL_LINE
+
+ // Check for non-digit chars in the rest of the stirng.
+ while (*str) {
+ if (!isdigit(*str))
+ return false;
+ else
+ ++str;