linux: fix -Wformat-truncation warning (#4793)

This commit is contained in:
Ben Noordhuis 2025-05-29 22:11:40 +02:00 committed by GitHub
parent 3a9a6e3e6b
commit b00c5d1a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2309,8 +2309,8 @@ static int uv__get_cgroupv2_constrained_cpu(const char* cgroup,
static const char cgroup_mount[] = "/sys/fs/cgroup";
const char* cgroup_trimmed;
char buf[1024];
char full_path[256];
char path[256];
char full_path[sizeof(path) + sizeof("/cpu.max")];
char quota_buf[16];
char* last_slash;
int cgroup_size;