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 }