tree-wide: a bunch of Coccinelle-suggested tweaks

rc2 edition
This commit is contained in:
Frantisek Sumsal
2023-07-14 17:39:05 +02:00
committed by Luca Boccassi
parent a4333be63a
commit be492020ec
4 changed files with 4 additions and 5 deletions

View File

@@ -535,8 +535,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne
for (const char *p = s + len; p < j; ) {
size_t slen = ansi_sequence_length(p, j - p);
if (slen > 0) {
memcpy(dst, p, slen);
dst += slen;
dst = mempcpy(dst, p, slen);
p += slen;
} else
p = utf8_next_char(p);