treg: appending to empty buffers - neatvi - [fork] simple vi-type editor with U… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 42fcac2533ea9fada01715d163a13d8ea7009465 | |
parent 896da02715d68d3031e31e3862ac249e4ce4e645 | |
Author: Ali Gholami Rudi <[email protected]> | |
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(-) | |
--- | |
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); |