treg: appending to empty buffers - neatvi - [fork] simple vi-type editor with UTF-8 support
HTML git clone git://src.adamsgaard.dk/neatvi
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR commit 42fcac2533ea9fada01715d163a13d8ea7009465
DIR parent 896da02715d68d3031e31e3862ac249e4ce4e645
HTML Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Fri, 5 Jan 2018 13:15:08 +0330
reg: appending to empty buffers
Diffstat:
M reg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/reg.c b/reg.c
t@@ -14,7 +14,7 @@ char *reg_get(int c, int *ln)
static void reg_putraw(int c, char *s, int ln)
{
- char *pre = isupper(c) ? bufs[tolower(c)] : "";
+ char *pre = isupper(c) && bufs[tolower(c)] ? bufs[tolower(c)] : "";
char *buf = malloc(strlen(pre) + strlen(s) + 1);
strcpy(buf, pre);
strcat(buf, s);