From eb403982b8826039f3c58b17b061803b90da29f5 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 15 Jun 2006 00:28:58 +0000 Subject: [PATCH] Fix MAX_PATH/PATH_MAX issue, closing #153 --- src/os-unix.c | 2 +- src/os-win32.c | 6 +++--- src/w32-eventlog.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/os-unix.c b/src/os-unix.c index 1ed3e762..7e4d3d08 100644 --- a/src/os-unix.c +++ b/src/os-unix.c @@ -483,7 +483,7 @@ char *os_apppath(char *parm) { } #else char *os_apppath(char *parm) { - char path[MAX_PATH]; + char path[PATH_MAX]; realpath(param,path); if(strrchr(path,'/')) { diff --git a/src/os-win32.c b/src/os-win32.c index 515748d1..07d45db4 100644 --- a/src/os-win32.c +++ b/src/os-win32.c @@ -612,7 +612,7 @@ char *os_configpath(void) { char dir[_MAX_DIR]; char working_dir[_MAX_PATH]; - GetModuleFileName(NULL,os_config_file,MAX_PATH); + GetModuleFileName(NULL,os_config_file,_MAX_PATH); _splitpath(os_config_file,drive,dir,NULL,NULL); _makepath(os_config_file,drive,dir,"mt-daapd","conf"); _makepath(working_dir,drive,dir,NULL,NULL); @@ -632,9 +632,9 @@ char *os_configpath(void) { * */ char *os_apppath(char *junk) { - char app_path[MAX_PATH]; + char app_path[_MAX_PATH]; - GetModuleFileName(NULL,app_path,MAX_PATH); + GetModuleFileName(NULL,app_path,_MAX_PATH); return strdup(app_path); } diff --git a/src/w32-eventlog.c b/src/w32-eventlog.c index d09a096c..d6794f9e 100644 --- a/src/w32-eventlog.c +++ b/src/w32-eventlog.c @@ -39,14 +39,14 @@ static HANDLE elog_handle = NULL; int elog_register(void) { HKEY reg_key = NULL; DWORD err = 0; - char path[MAX_PATH]; + char path[_MAX_PATH]; DWORD event_types; wsprintf(path,"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s", PACKAGE); if((err=RegCreateKey(HKEY_LOCAL_MACHINE, path, ®_key)) != ERROR_SUCCESS) return FALSE; - GetModuleFileName(NULL, path, MAX_PATH ); + GetModuleFileName(NULL, path, _MAX_PATH ); err=RegSetValueEx(reg_key, "EventMessageFile",0,REG_EXPAND_SZ,path,(DWORD)strlen(path) + 1); if(err != ERROR_SUCCESS) {