do {
bool rm = false;
char attach_cgroup[STRLITERALLEN(".lxc-/cgroup.procs") + INTTYPE_TO_STRLEN(int) + 1];
- char *slash;
+ char *slash = attach_cgroup;
ret = snprintf(attach_cgroup, sizeof(attach_cgroup), ".lxc-%d/cgroup.procs", idx);
if (ret < 0 || (size_t)ret >= sizeof(attach_cgroup))
if (ret < STRLITERALLEN(".lxc-/cgroup.procs"))
return log_error_errno(-EINVAL, EINVAL, "Unexpected short write would cause buffer-overrun");
- slash = &attach_cgroup[ret] - STRLITERALLEN("/cgroup.procs");
+ slash += (ret - STRLITERALLEN("/cgroup.procs"));
*slash = '\0';
ret = mkdirat(unified_fd, attach_cgroup, 0755);