-static int
-check_sp(CHKARGS)
-{
- long lval;
- char *ep, *buf;
-
- if (NULL == n->child)
- return(1);
- else if ( ! check_eq1(m, n))
- return(0);
-
- assert(MAN_TEXT == n->child->type);
- buf = n->child->string;
- assert(buf);
-
- /* From OpenBSD's strtol(3). */
-
- errno = 0;
- lval = strtol(buf, &ep, 10);
- if (buf[0] == '\0' || *ep != '\0')
- return(man_nerr(m, n->child, WNUMFMT));
-
- if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) ||
- (lval > INT_MAX || lval < 0))
- return(man_nerr(m, n->child, WNUMFMT));
-
- return(1);
-}
-
-