Refactor, add new helper fn paste() to concat directory compoents

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg authored and Jacques de Laval committed 2021-02-26 10:32:54 +01:00
1 parent 6f06c432ec
commit a1f79e263a
5 files changed
+19 -8

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ static inline char *pid_runpath(const char *file, char *path, size_t len)
else if (!strncmp(file, "/run/", 5))
file += 5;
rc = snprintf(path, len, "%s/%s", prefix, file);
rc = paste(path, len, prefix, file);
if (rc < 0 || (size_t)rc >= len)
_e("File path '%s' truncated, should end with '%s'", path, file);