- if (get_createfile_parameters(key, NSSM_REG_STDOUT, path, &sharing, NSSM_STDOUT_SHARING, &disposition, NSSM_STDOUT_DISPOSITION, &flags, NSSM_STDOUT_FLAGS)) return 3;\r
- if (path[0]) {\r
- /* Remember path for comparison with stderr. */\r
- if (_sntprintf_s(stdout_path, _countof(stdout_path), _TRUNCATE, _T("%s"), path) < 0) {\r
- log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, _T("stdout_path"), _T("get_output_handles"), 0);\r
- return 4;\r
- }\r
-\r
- if (service->rotate_files) rotate_file(service->name, path, service->rotate_seconds, service->rotate_bytes_low, service->rotate_bytes_high);\r
- si->hStdOutput = append_to_file(path, sharing, &attributes, disposition, flags);\r
- if (! si->hStdOutput) return 5;\r
+ if (get_createfile_parameters(key, NSSM_REG_STDOUT, service->stdout_path, &service->stdout_sharing, NSSM_STDOUT_SHARING, &service->stdout_disposition, NSSM_STDOUT_DISPOSITION, &service->stdout_flags, NSSM_STDOUT_FLAGS)) {\r
+ service->stdout_sharing = service->stdout_disposition = service->stdout_flags = 0;\r
+ ZeroMemory(service->stdout_path, _countof(service->stdout_path) * sizeof(TCHAR));\r
+ return 3;\r
+ }\r
+ if (si && service->stdout_path[0]) {\r
+ if (service->rotate_files) rotate_file(service->name, service->stdout_path, service->rotate_seconds, service->rotate_bytes_low, service->rotate_bytes_high);\r
+ si->hStdOutput = append_to_file(service->stdout_path, service->stdout_sharing, &attributes, service->stdout_disposition, service->stdout_flags);\r
+ if (! si->hStdOutput) return 4;\r