vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 16ece44c0b753e3eb8cb8419301e234108ee52c8 parent f641856dd6039f570dd2066016d622768f7a6fde Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 18 Feb 2016 16:12:46 +0100 vis: fix possible undefined zero allocation Diffstat:
| M | main.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.c b/main.c @@ -1211,7 +1211,7 @@ static const char *cursors_align_indent(Vis *vis, const char *keys, const Arg *a } size_t len = maxcol - mincol; - char *buf = malloc(len); + char *buf = malloc(len+1); if (!buf) return keys; memset(buf, ' ', len);