aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Rees <maxcrees@me.com> 2021-01-03 02:59:26 -0500
committerMax Rees <maxcrees@me.com> 2021-01-03 02:59:26 -0500
commit7a45464632b3b439925169716b5979b98009990e (patch)
tree5e95cde22e4c62598efdd1038947d4ab92ba3584
parent174b5a4bdb9a35e6de9f52f2a073e5c2a66a126b (diff)
util: note procpath size
-rw-r--r--src/util.c4
-rw-r--r--src/util.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index 97e88b7..982ef25 100644
--- a/src/util.c
+++ b/src/util.c
@@ -7,7 +7,7 @@
#include "comproot.h"
#include "util.h"
-int get_fd_path(pid_t pid, int fd, char *procpath) {
+int get_fd_path(pid_t pid, int fd, char procpath[PATH_MAX]) {
int rc = -1;
errno = 0;
@@ -24,7 +24,7 @@ int get_fd_path(pid_t pid, int fd, char *procpath) {
return 0;
}
-int chdir_to_fd(pid_t pid, int fd, char *procpath) {
+int chdir_to_fd(pid_t pid, int fd, char procpath[PATH_MAX]) {
if (get_fd_path(pid, fd, procpath) == -1)
return -1;
diff --git a/src/util.h b/src/util.h
index 70e1633..5a512f3 100644
--- a/src/util.h
+++ b/src/util.h
@@ -6,8 +6,8 @@
#include "comproot.h"
-int get_fd_path(pid_t pid, int fd, char *procpath);
-int chdir_to_fd(pid_t pid, int fd, char *procpath);
+int get_fd_path(pid_t pid, int fd, char procpath[PATH_MAX]);
+int chdir_to_fd(pid_t pid, int fd, char procpath[PATH_MAX]);
#define A_PROC_VM_BUFS const struct iovec liov[], unsigned long nl, const struct iovec riov[], unsigned long nr
int tx_data(A_HANDLER_FD, A_HANDLER_REQ, A_PROC_VM_BUFS, int push);