commit e1785c769914baab05e01fe355471ec260ad013f
parent 14edf4199d2cbd83c95e4d9f8b60cb9e96cce012
Author: sewn <sewn@disroot.org>
Date: Wed, 18 Jun 2025 17:18:22 +0300
fix insert codepath for an annoying glibc
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mew.c b/mew.c
@@ -419,7 +419,7 @@ insert(const char *str, ssize_t n)
return;
/* move existing text out of the way, insert new text, and update cursor */
memmove(&text[cursor + n], &text[cursor], sizeof text - cursor - MAX(n, 0));
- if (n > 0)
+ if (str)
memcpy(&text[cursor], str, n);
cursor += n;
match();