Fix MAX_PATH/PATH_MAX issue, closing #153

This commit is contained in:
Ron Pedde 2006-06-15 00:28:58 +00:00
parent 74f95473cb
commit eb403982b8
3 changed files with 6 additions and 6 deletions

View File

@ -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,'/')) {

View File

@ -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);
}

View File

@ -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, &reg_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) {