]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
specifier: use mempcpy() where we can 30515/head
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Dec 2023 09:24:50 +0000 (10:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Dec 2023 09:28:03 +0000 (10:28 +0100)
src/shared/specifier.c

index e5a1f94f2a2945478c6c9f2918ea18fb19ccfaa3..a56b8365fb4bd9569683c3d7576e235ec30c9df4 100644 (file)
@@ -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;