From 1d5cfebaca0eef694bd56cf82962e91d1a0fa39c Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Fri, 26 Aug 2005 10:05:59 +0000 Subject: [PATCH] Fix a one byte off error which causes "less" to crash if you view a large file, jump to the end, scroll backwards with "b" and try to search backwards afterwards. Submitted by: Matthias Scheler --- contrib/less/line.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/less/line.c b/contrib/less/line.c index 14659f399c1f..b537d353084b 100644 --- a/contrib/less/line.c +++ b/contrib/less/line.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* * Copyright (C) 1984-2002 Mark Nudelman * @@ -911,8 +912,8 @@ back_raw_line(curr_pos, linep) /* * Shift the data to the end of the new linebuf. */ - for (fm = linebuf + old_size_linebuf, - to = linebuf + size_linebuf; + for (fm = linebuf + old_size_linebuf - 1, + to = linebuf + size_linebuf - 1; fm >= linebuf; fm--, to--) *to = *fm; n = size_linebuf - old_size_linebuf;