-/* $Id: tbl_layout.c,v 1.48 2018/12/14 05:18:03 schwarze Exp $ */
+/* $Id: tbl_layout.c,v 1.49 2020/09/01 18:25:28 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
int ln, const char *p, int *pos)
{
char *endptr;
+ unsigned long spacing;
size_t sz;
mod:
/* Parse numerical spacing from modifier string. */
if (isdigit((unsigned char)p[*pos])) {
- cp->spacing = strtoull(p + *pos, &endptr, 10);
+ if ((spacing = strtoul(p + *pos, &endptr, 10)) > 9)
+ mandoc_msg(MANDOCERR_TBLLAYOUT_SPC, ln, *pos,
+ "%lu", spacing);
+ else
+ cp->spacing = spacing;
*pos = endptr - p;
goto mod;
}