- char pid_string[16], code[16];
- _snprintf(pid_string, sizeof(pid_string), "%d", pid);
- _snprintf(code, sizeof(code), "%d", exitcode);
- log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_KILLING, service_name, pid_string, code, 0);
+ TCHAR pid_string[16], code[16];
+ _sntprintf_s(pid_string, _countof(pid_string), _TRUNCATE, _T("%lu"), pid);
+ _sntprintf_s(code, _countof(code), _TRUNCATE, _T("%lu"), exitcode);
+ log_event(EVENTLOG_INFORMATION_TYPE, NSSM_EVENT_KILLING, service->name, pid_string, code, 0);