diff --git a/common/JackClient.cpp b/common/JackClient.cpp index 1ba01a8c..92cd07da 100644 --- a/common/JackClient.cpp +++ b/common/JackClient.cpp @@ -961,7 +961,7 @@ int JackClient::InternalClientLoad(const char* client_name, jack_options_t optio return 0; } - if (va->load_name && (strlen(va->load_name) >= PATH_MAX)) { + if (va->load_name && (strlen(va->load_name) >= JACK_PATH_MAX)) { jack_error("\"%s\" is too long for a shared object name.\n" "Please use %lu characters or less.", va->load_name, PATH_MAX); diff --git a/common/JackDriverLoader.cpp b/common/JackDriverLoader.cpp index d743070b..3175b8c2 100644 --- a/common/JackDriverLoader.cpp +++ b/common/JackDriverLoader.cpp @@ -493,7 +493,7 @@ jack_get_descriptor (JSList * drivers, const char * sofile, const char * symbol) } } - strncpy(descriptor->file, filename, PATH_MAX); + strncpy(descriptor->file, filename, JACK_PATH_MAX); free(filename); return descriptor; } diff --git a/common/JackInternalClient.cpp b/common/JackInternalClient.cpp index 947f0663..b990d607 100644 --- a/common/JackInternalClient.cpp +++ b/common/JackInternalClient.cpp @@ -173,7 +173,7 @@ JackClientControl* JackInternalClient::GetClientControl() const void JackLoadableInternalClient::Init(const char* so_name) { - char path_to_so[PATH_MAX + 1]; + char path_to_so[JACK_PATH_MAX + 1]; BuildClientPath(path_to_so, sizeof(path_to_so), so_name); fHandle = LoadJackModule(path_to_so); diff --git a/common/JackTools.cpp b/common/JackTools.cpp index e4fc9604..48cec0b9 100644 --- a/common/JackTools.cpp +++ b/common/JackTools.cpp @@ -89,7 +89,7 @@ namespace Jack { #else char* JackTools::UserDir() { - static char user_dir[PATH_MAX + 1] = ""; + static char user_dir[JACK_PATH_MAX + 1] = ""; /* format the path name on the first call */ if (user_dir[0] == '\0') { @@ -107,9 +107,9 @@ namespace Jack { char* JackTools::ServerDir(const char* server_name, char* server_dir) { /* format the path name into the suppled server_dir char array, - * assuming that server_dir is at least as large as PATH_MAX+1 */ + * assuming that server_dir is at least as large as JACK_PATH_MAX + 1 */ - snprintf(server_dir, PATH_MAX + 1, "%s/%s", UserDir(), server_name); + snprintf(server_dir, JACK_PATH_MAX + 1, "%s/%s", UserDir(), server_name); return server_dir; } @@ -117,7 +117,7 @@ namespace Jack { { DIR* dir; struct dirent *dirent; - char dir_name[PATH_MAX + 1] = ""; + char dir_name[JACK_PATH_MAX + 1] = ""; ServerDir(server_name, dir_name); /* On termination, we remove all files that jackd creates so @@ -144,7 +144,7 @@ namespace Jack { /* unlink all the files in this directory, they are mine */ while ((dirent = readdir(dir)) != NULL) { - char fullpath[PATH_MAX + 1]; + char fullpath[JACK_PATH_MAX + 1]; if ((strcmp(dirent->d_name, ".") == 0) || (strcmp (dirent->d_name, "..") == 0)) { continue; @@ -175,7 +175,7 @@ namespace Jack { int JackTools::GetTmpdir() { FILE* in; size_t len; - char buf[PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */ + char buf[JACK_PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */ if ((in = popen("jackd -l", "r")) == NULL) { return -1; diff --git a/common/driver_interface.h b/common/driver_interface.h index 5a6138e6..15c8e27f 100644 --- a/common/driver_interface.h +++ b/common/driver_interface.h @@ -35,6 +35,7 @@ extern "C" #define JACK_DRIVER_PARAM_NAME_MAX 15 #define JACK_DRIVER_PARAM_STRING_MAX 63 #define JACK_DRIVER_PARAM_DESC 255 +#define JACK_PATH_MAX 511 /** Driver parameter types */ typedef enum @@ -79,7 +80,7 @@ extern "C" typedef struct { char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */ char desc[JACK_DRIVER_PARAM_DESC + 1]; /**< The driver's extended description */ - char file[PATH_MAX + 1]; /**< The filename of the driver's shared object file */ + char file[JACK_PATH_MAX + 1]; /**< The filename of the driver's shared object file */ uint32_t nparams; /**< The number of parameters the driver has */ jack_driver_param_desc_t * params; /**< An array of parameter descriptors */ } diff --git a/windows/JackSystemDeps_os.h b/windows/JackSystemDeps_os.h index fc3c8b7f..49619571 100644 --- a/windows/JackSystemDeps_os.h +++ b/windows/JackSystemDeps_os.h @@ -24,7 +24,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #pragma warning (disable : 4786) -#define PATH_MAX 1024 #define ENOBUFS 55 #endif