about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--edit.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/edit.c b/edit.c
index 34b89fe..d9b7673 100644
--- a/edit.c
+++ b/edit.c
@@ -66,7 +66,7 @@ static struct {
 
 static bool reserve(size_t index, size_t count) {
 	if (len + count > Cap) return false;
-	memmove(&buf[index + count], &buf[index], sizeof(*buf) * (len - index));
+	wmemmove(&buf[index + count], &buf[index], len - index);
 	len += count;
 	return true;
 }
@@ -74,12 +74,10 @@ static bool reserve(size_t index, size_t count) {
 static void delete(bool copy, size_t index, size_t count) {
 	if (index + count > len) return;
 	if (copy) {
-		memcpy(cut.buf, &buf[index], sizeof(*buf) * count);
+		wmemcpy(cut.buf, &buf[index], count);
 		cut.len = count;
 	}
-	memmove(
-		&buf[index], &buf[index + count], sizeof(*buf) * (len - index - count)
-	);
+	wmemmove(&buf[index], &buf[index + count], len - index - count);
 	len -= count;
 }
 
@@ -185,7 +183,7 @@ static void tabComplete(uint id) {
 		reserve(tab.pos, tab.len);
 		buf[tab.pos + n] = L' ';
 	}
-	memcpy(&buf[tab.pos], wcs, sizeof(*wcs) * n);
+	wmemcpy(&buf[tab.pos], wcs, n);
 	pos = tab.pos + tab.len;
 }
 
@@ -234,7 +232,7 @@ void edit(uint id, enum Edit op, wchar_t ch) {
 		}
 		break; case EditPaste: {
 			if (reserve(pos, cut.len)) {
-				memcpy(&buf[pos], cut.buf, sizeof(*buf) * cut.len);
+				wmemcpy(&buf[pos], cut.buf, cut.len);
 				pos += cut.len;
 			}
 		}
rJune McEnroe 2019-12-26Add \S to sort inside bracesJune McEnroe 2019-12-23Reformat music.txtJune McEnroe 2019-12-23Rename music.md to music.txtJune McEnroe 2019-12-23Add DO YOU DOUBT ME TRAITORJune McEnroe 2019-12-22Add license header to cgit CSSJune McEnroe 2019-12-22Add The Book of EttaJune McEnroe 2019-12-21Revert "Add first working version of imbox"June McEnroe 2019-12-21Add first working version of imboxJune McEnroe 2019-12-20Respect mailmap in gl pretty formatJune McEnroe 2019-12-20Set LANG in cgit filtersJune McEnroe 2019-12-20Source .editrc before applying -v or -eJune McEnroe 2019-12-20Disable signing commitsJune McEnroe 2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe