From: Iain Patterson Date: Sun, 28 Feb 2016 08:46:49 +0000 (+0000) Subject: Use service_registry_path() in create_exit_action(). X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=d47dca0afe81c1c8e75c518da5a51829e61ad1cd;p=nssm.git Use service_registry_path() in create_exit_action(). As a result of registry function refactoring we were constructing the default path to AppExit incorrectly. Using the function created for the purpose works correctly, unsurprisingly. Thanks Igor Zenkov. --- diff --git a/registry.cpp b/registry.cpp index 20033f8..228ef8d 100644 --- a/registry.cpp +++ b/registry.cpp @@ -189,7 +189,7 @@ int create_parameters(nssm_service_t *service, bool editing) { int create_exit_action(TCHAR *service_name, const TCHAR *action_string, bool editing) { /* Get registry */ TCHAR registry[KEY_LENGTH]; - if (_sntprintf_s(registry, _countof(registry), _TRUNCATE, NSSM_REGISTRY _T("\\%s"), service_name, NSSM_REG_EXIT) < 0) { + if (service_registry_path(service_name, true, NSSM_REG_EXIT, registry, _countof(registry)) < 0) { log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, _T("NSSM_REG_EXIT"), _T("create_exit_action()"), 0); return 1; }