diff options
-rw-r--r-- | term_ascii.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/term_ascii.c b/term_ascii.c index ee630493..77a3d591 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -63,6 +63,8 @@ ascii_init(enum termenc enc, const struct mchars *mchars, char *outopts) const char *toks[5]; char *v; struct termp *p; + const char *errstr; + int num; p = mandoc_calloc(1, sizeof(struct termp)); @@ -109,10 +111,14 @@ ascii_init(enum termenc enc, const struct mchars *mchars, char *outopts) while (outopts && *outopts) switch (getsubopt(&outopts, UNCONST(toks), &v)) { case 0: - p->defindent = (size_t)atoi(v); + num = strtonum(v, 0, 1000, &errstr); + if (!errstr) + p->defindent = num; break; case 1: - p->defrmargin = (size_t)atoi(v); + num = strtonum(v, 0, 1000, &errstr); + if (!errstr) + p->defrmargin = num; break; case 2: /* |