- else if ( ! eerr_eq1(mdoc))
- return(0);
-
- assert(MDOC_TEXT == mdoc->last->child->type);
- buf = mdoc->last->child->string;
- assert(buf);
-
- /* From OpenBSD's strtol(3). */
- errno = 0;
- lval = strtol(buf, &ep, 10);
- if (buf[0] == '\0' || *ep != '\0')
- return(mdoc_nerr(mdoc, mdoc->last->child, ENUMFMT));
-
- if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) ||
- (lval > INT_MAX || lval < 0))
- return(mdoc_nerr(mdoc, mdoc->last->child, ENUMFMT));
-
- return(1);