summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-08-13 01:21:36 +0000
committerache <ache@FreeBSD.org>1997-08-13 01:21:36 +0000
commit89f12e03aa02b447a9d101ff7bb03ce87c2810c9 (patch)
tree246abee49f4a881cd216373e7be37ca0a06d0470 /lib
parent2d758a45281f2bb6c6b41405f0e511a40c188bef (diff)
downloadFreeBSD-src-89f12e03aa02b447a9d101ff7bb03ce87c2810c9.zip
FreeBSD-src-89f12e03aa02b447a9d101ff7bb03ce87c2810c9.tar.gz
Fix longstanding bug with buffer pointer goes beyoud buffer start
Cause initscr (ncurses) fail in some cases
Diffstat (limited to 'lib')
-rw-r--r--lib/libmytinfo/findterm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libmytinfo/findterm.c b/lib/libmytinfo/findterm.c
index 1fe5a9b..8fc41a0 100644
--- a/lib/libmytinfo/findterm.c
+++ b/lib/libmytinfo/findterm.c
@@ -47,7 +47,7 @@ int len; {
c = getc(f);
}
- while(isspace(*(buf-1))) {
+ while(i > 0 && isspace(*(buf-1))) {
buf--;
i--;
}
OpenPOWER on IntegriCloud