mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
Fix MAX_PATH/PATH_MAX issue, closing #153
This commit is contained in:
parent
74f95473cb
commit
eb403982b8
@ -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,'/')) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user