From d37a9bfece8a8cb464d6ee3193d6fd572f45046e Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Tue, 24 Feb 2026 14:58:11 +0100 Subject: [PATCH] PATH_MAX is not portable -- do not use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scitokens-cpp-1.3.0/test/test_utils.h:43:26: error: ‘PATH_MAX’ was not declared in this scope --- test/test_utils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_utils.h b/test/test_utils.h index 8b13f9f..bdbf9db 100644 --- a/test/test_utils.h +++ b/test/test_utils.h @@ -40,9 +40,10 @@ class SecureTempDir { base = std::string(binary_dir) + "/tests"; } else { // Fallback: use current working directory + tests - char cwd[PATH_MAX]; - if (getcwd(cwd, sizeof(cwd))) { + char *cwd = getcwd(nullptr, 0); + if (cwd) { base = std::string(cwd) + "/tests"; + free(cwd); } else { base = "/tmp"; // Last resort fallback }