mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-25 21:53:17 -05:00
PATH_MAX vs MAX_PATH fixes. Stupid windows.
This commit is contained in:
parent
16b323f024
commit
654d0fe685
@ -262,7 +262,7 @@ void scan_process_playlistlist(void) {
|
||||
int scan_init(char **patharray) {
|
||||
int err=0;
|
||||
int index=0;
|
||||
char resolved_path[MAX_PATH];
|
||||
char resolved_path[PATH_MAX];
|
||||
|
||||
DPRINTF(E_DBG,L_SCAN,"Starting scan_init\n");
|
||||
|
||||
|
@ -61,7 +61,7 @@ typedef struct tag_osfileinfo {
|
||||
|
||||
/* Globals */
|
||||
OSFILEINFO file_info[MAXDESC];
|
||||
char os_config_file[_MAX_PATH];
|
||||
char os_config_file[PATH_MAX];
|
||||
char *os_w32_socket_states[] = {
|
||||
"Closed/Unused",
|
||||
"Open/Listening",
|
||||
@ -83,14 +83,14 @@ int os_init(int foreground, char *runas) {
|
||||
int err;
|
||||
char *inifile;
|
||||
char drive_buffer[4];
|
||||
char drive_map[MAX_PATH];
|
||||
char drive_map[PATH_MAX];
|
||||
int drive_letter;
|
||||
|
||||
inifile=_os_filepath("mapping.ini");
|
||||
DPRINTF(E_LOG,L_MISC,"Building drive mapping table from %s\n",inifile);
|
||||
for(drive_letter = 'a'; drive_letter <= 'z'; drive_letter++) {
|
||||
sprintf(drive_buffer,"%c",drive_letter);
|
||||
GetPrivateProfileString("mapping",drive_buffer,"",drive_map,MAX_PATH,inifile);
|
||||
GetPrivateProfileString("mapping",drive_buffer,"",drive_map,PATH_MAX,inifile);
|
||||
if(strlen(drive_map)) {
|
||||
os_drive_maps[drive_letter - 'a'] = strdup(drive_map);
|
||||
DPRINTF(E_LOG,L_MISC,"Mapped %c to %s\n",drive_letter,drive_map);
|
||||
@ -565,9 +565,9 @@ char *os_configpath(void) {
|
||||
char *_os_filepath(char *file) {
|
||||
char drive[_MAX_DRIVE];
|
||||
char dir[_MAX_DIR];
|
||||
char path[_MAX_PATH];
|
||||
char path[PATH_MAX];
|
||||
|
||||
GetModuleFileName(NULL,path,_MAX_PATH);
|
||||
GetModuleFileName(NULL,path,PATH_MAX);
|
||||
_splitpath(path,drive,dir,NULL,NULL);
|
||||
_makepath(path,drive,dir,NULL,NULL);
|
||||
strcat(path,file);
|
||||
@ -580,9 +580,9 @@ char *_os_filepath(char *file) {
|
||||
*
|
||||
*/
|
||||
char *os_apppath(char *junk) {
|
||||
char app_path[_MAX_PATH];
|
||||
char app_path[PATH_MAX];
|
||||
|
||||
GetModuleFileName(NULL,app_path,_MAX_PATH);
|
||||
GetModuleFileName(NULL,app_path,PATH_MAX);
|
||||
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[PATH_MAX];
|
||||
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, PATH_MAX);
|
||||
|
||||
err=RegSetValueEx(reg_key, "EventMessageFile",0,REG_EXPAND_SZ,path,(DWORD)strlen(path) + 1);
|
||||
if(err != ERROR_SUCCESS) {
|
||||
|
@ -225,9 +225,9 @@ void *service_startup(void *arg) {
|
||||
void service_register(void) {
|
||||
SC_HANDLE scm;
|
||||
SC_HANDLE svc;
|
||||
char path[MAX_PATH];
|
||||
char path[PATH_MAX];
|
||||
|
||||
GetModuleFileName(NULL, path, MAX_PATH );
|
||||
GetModuleFileName(NULL, path, PATH_MAX );
|
||||
|
||||
if(!(scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE))) {
|
||||
DPRINTF(E_FATAL,L_MISC,"Cannot open service control manager\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user