mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -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
|
#else
|
||||||
char *os_apppath(char *parm) {
|
char *os_apppath(char *parm) {
|
||||||
char path[MAX_PATH];
|
char path[PATH_MAX];
|
||||||
|
|
||||||
realpath(param,path);
|
realpath(param,path);
|
||||||
if(strrchr(path,'/')) {
|
if(strrchr(path,'/')) {
|
||||||
|
@ -612,7 +612,7 @@ char *os_configpath(void) {
|
|||||||
char dir[_MAX_DIR];
|
char dir[_MAX_DIR];
|
||||||
char working_dir[_MAX_PATH];
|
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);
|
_splitpath(os_config_file,drive,dir,NULL,NULL);
|
||||||
_makepath(os_config_file,drive,dir,"mt-daapd","conf");
|
_makepath(os_config_file,drive,dir,"mt-daapd","conf");
|
||||||
_makepath(working_dir,drive,dir,NULL,NULL);
|
_makepath(working_dir,drive,dir,NULL,NULL);
|
||||||
@ -632,9 +632,9 @@ char *os_configpath(void) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *os_apppath(char *junk) {
|
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);
|
return strdup(app_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,14 +39,14 @@ static HANDLE elog_handle = NULL;
|
|||||||
int elog_register(void) {
|
int elog_register(void) {
|
||||||
HKEY reg_key = NULL;
|
HKEY reg_key = NULL;
|
||||||
DWORD err = 0;
|
DWORD err = 0;
|
||||||
char path[MAX_PATH];
|
char path[_MAX_PATH];
|
||||||
DWORD event_types;
|
DWORD event_types;
|
||||||
|
|
||||||
wsprintf(path,"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s", PACKAGE);
|
wsprintf(path,"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\%s", PACKAGE);
|
||||||
if((err=RegCreateKey(HKEY_LOCAL_MACHINE, path, ®_key)) != ERROR_SUCCESS)
|
if((err=RegCreateKey(HKEY_LOCAL_MACHINE, path, ®_key)) != ERROR_SUCCESS)
|
||||||
return FALSE;
|
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);
|
err=RegSetValueEx(reg_key, "EventMessageFile",0,REG_EXPAND_SZ,path,(DWORD)strlen(path) + 1);
|
||||||
if(err != ERROR_SUCCESS) {
|
if(err != ERROR_SUCCESS) {
|
||||||
|
Loading…
Reference in New Issue
Block a user