]> git.mdlowis.com Git - projs/tide.git/commitdiff
moving right by word should not move past end of buffer
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 7 Dec 2016 03:27:27 +0000 (22:27 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 7 Dec 2016 03:27:27 +0000 (22:27 -0500)
libedit/buf.c

index 0e981e99d70cb1f161a685cce6ecafb31f33bb12..70c503044722efc062528aaabf2c85442299b3e2 100644 (file)
@@ -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;
 }