mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 11:53:16 +00:00
pulse-server: use sizeof()
instead of hard-coding
Use `sizeof("/pid")` instead of hard-coding 5 in the condition.
This commit is contained in:
parent
627ef37a77
commit
b6405b761f
|
@ -193,7 +193,7 @@ int create_pid_file(void) {
|
|||
if ((res = get_runtime_dir(pid_file, sizeof(pid_file), "pulse")) < 0)
|
||||
return res;
|
||||
|
||||
if (strlen(pid_file) > PATH_MAX - 5) {
|
||||
if (strlen(pid_file) > PATH_MAX - sizeof("/pid")) {
|
||||
pw_log_error(NAME": path too long: %s/pid", pid_file);
|
||||
return -ENAMETOOLONG;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue