summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index dc9800b..729594d 100644
--- a/main.c
+++ b/main.c
@@ -813,7 +813,7 @@ search_from_end:
int read_search(void) {
Str src = get_input_line(S("Search: "));
if (!src.n) return 0;
- e.search.s = malloc(src.n);
+ e.search.s = realloc(e.search.s, src.n);
if (!e.search.s) FAIL_WITH_MSG("failed to allocate search");
memcpy(e.search.s, src.s, src.n);
e.search.n = src.n;