vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 309672a0255bc2c6a453e0df753b9358855deb0d parent aea3c7cb1142ec6c077000452c51cd9ba29c9d92 Author: Marc André Tanner <mat@brain-dump.org> Date: Sun, 28 Sep 2014 10:58:20 +0200 Improve argument validation in text_insert Diffstat:
| M | text.c | | | 2 | ++ |
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/text.c b/text.c @@ -504,6 +504,8 @@ static void change_free(Change *c) { * \-+ <-- +-----+ <-- +---------------+ <-- +-/ */ bool text_insert(Text *txt, size_t pos, const char *data, size_t len) { + if (len == 0) + return true; if (pos > txt->size) return false; if (pos < txt->lines.pos)