aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 27d6d938..471c52ca 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.362 2017/06/07 17:38:26 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.363 2017/06/08 12:54:58 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -533,8 +533,10 @@ static int
a2width(const struct termp *p, const char *v)
{
struct roffsu su;
+ const char *end;
- if (a2roffsu(v, &su, SCALE_MAX) < 2) {
+ end = a2roffsu(v, &su, SCALE_MAX);
+ if (end == NULL || *end != '\0') {
SCALE_HS_INIT(&su, term_strlen(p, v));
su.scale /= term_strlen(p, "0");
}