From a7d57ab9d5cdd11ea19122b4e6cf8d2eb307f043 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Wed, 4 Dec 2019 01:20:53 +0900 Subject: [PATCH] Fix of PATH_MAX for GNU/Hurd PATH_MAX is not defined on each platform, and should be avoided. Info: - https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html - https://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL --- src/manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/manager.c b/src/manager.c index f8682ae2..a3827c0f 100644 --- a/src/manager.c +++ b/src/manager.c @@ -1131,8 +1131,9 @@ main(int argc, char **argv) } if (manager_address == NULL) { - manager_address = ss_malloc(PATH_MAX); - snprintf(manager_address, PATH_MAX, "%s/.ss-manager.socks", workdir); + size_t manager_address_size = strlen(workdir) + 20; + manager_address = ss_malloc(manager_address_size); + snprintf(manager_address, manager_address_size, "%s/.ss-manager.socks", workdir); LOGI("using the default manager address: %s", manager_address); }