commit e78813a41db558f6b42175d73378439b326f78e2
parent c64df99ebbce83c4f352e4dd23c7fd69adda1bc3
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 10 Dec 2015 18:47:56 +0100
Fix compile()
Compile was wrong because it was marking the end of string
in an incorrect place.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ed.c b/ed.c
@@ -290,7 +290,7 @@ compile()
/* TODO: Use addchar here! */
error("too long regular expression");
}
- buff[buff - bp] = '\0';
+ buff[bp - buff] = '\0';
if (!pattern && (!(pattern = malloc(sizeof(*pattern)))))
error("out of memory");