summaryrefslogtreecommitdiffstats
path: root/man_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-11 00:39:00 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-11 00:39:00 +0000
commitc68f7a36a22b06ab0bb6afcd32d531d893abbc57 (patch)
tree909c9bdb457465ab9f1333d3e80b2692a092ac12 /man_term.c
parente86d735736590229d3795c7000334674b1b54359 (diff)
downloadmandoc-c68f7a36a22b06ab0bb6afcd32d531d893abbc57.tar.gz
Don't let `in' creep past the right margin.
From an assertion noted by Brad (at comstyle).
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/man_term.c b/man_term.c
index 8394e3e8..29148d65 100644
--- a/man_term.c
+++ b/man_term.c
@@ -397,6 +397,11 @@ pre_in(DECL_ARGS)
else
p->offset = v;
+ /* Don't let this creep beyond the right margin. */
+
+ if (p->offset > p->rmargin)
+ p->offset = p->rmargin;
+
return(0);
}