From d3936664030b6c1e0fd9cdca2c4f81e3bb12e9ab Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 18 Dec 2023 10:24:50 +0100 Subject: [PATCH] specifier: use mempcpy() where we can --- src/shared/specifier.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/specifier.c b/src/shared/specifier.c index e5a1f94f2a2..a56b8365fb4 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -78,8 +78,7 @@ int specifier_printf(const char *text, size_t max_length, const Specifier table[ if (!GREEDY_REALLOC(result, j + k + l + 1)) return -ENOMEM; - memcpy(result + j, w, k); - t = result + j + k; + t = mempcpy(result + j, w, k); } else if (strchr(POSSIBLE_SPECIFIERS, *f)) /* Oops, an unknown specifier. */ return -EBADSLT;