From: Lennart Poettering Date: Mon, 18 Dec 2023 09:24:50 +0000 (+0100) Subject: specifier: use mempcpy() where we can X-Git-Tag: v256-rc1~1471^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30515%2Fhead;p=thirdparty%2Fsystemd.git specifier: use mempcpy() where we can --- 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;