basic/memory-util: introduce mempcpy_typesafe

This commit is contained in:
Mike Yuan
2024-09-20 08:29:35 +09:00
committed by Yu Watanabe
parent 48837c6500
commit eda6223942
7 changed files with 16 additions and 14 deletions
+1 -1
View File
@@ -380,7 +380,7 @@ static int context_write_data_local_rtc(Context *c) {
if (!w)
return -ENOMEM;
*(char*) mempcpy(stpcpy(stpcpy(mempcpy(w, s, a), prepend), c->local_rtc ? "LOCAL" : "UTC"), e, b) = 0;
*mempcpy_typesafe(stpcpy(stpcpy(mempcpy(w, s, a), prepend), c->local_rtc ? "LOCAL" : "UTC"), e, b) = 0;
if (streq(w, NULL_ADJTIME_UTC)) {
if (unlink("/etc/adjtime") < 0)