From 5e6fd78525e0976e02b4fe2de55f0064a648cefe Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Tue, 11 Jan 2011 00:39:00 +0000 Subject: Don't let `in' creep past the right margin. From an assertion noted by Brad (at comstyle). --- man_term.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index c0ef70db..8500ad9f 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.94 2011/01/04 01:23:18 schwarze Exp $ */ +/* $Id: man_term.c,v 1.95 2011/01/11 00:39:00 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -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); } -- cgit v1.2.3