From 4660bcd81f6937497e9f4f97a1fc33ad632f0378 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 6 Dec 2016 22:27:27 -0500 Subject: [PATCH] moving right by word should not move past end of buffer --- libedit/buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libedit/buf.c b/libedit/buf.c index 0e981e9..70c5030 100644 --- a/libedit/buf.c +++ b/libedit/buf.c @@ -406,7 +406,7 @@ unsigned buf_byword(Buf* buf, unsigned off, int count) { } else { for (; off < end && risword(buf_get(buf, off+1)); off++); for (; off < end && !risword(buf_get(buf, off+1)); off++); - off++; + if (off < buf_end(buf)) off++; } return off; } -- 2.49.0