X-Git-Url: http://git.iain.cx/?p=nssm.git;a=blobdiff_plain;f=event.cpp;h=b44482c2ab2fc2fdcccfcf05f7a0efe426fed394;hp=a409b11761ff65c9685cfc2651c4926e5bc9b965;hb=HEAD;hpb=8754d6de6c36a1859ad0adfef1e456b4a2ebd3a6 diff --git a/event.cpp b/event.cpp index a409b11..b44482c 100644 --- a/event.cpp +++ b/event.cpp @@ -1,5 +1,6 @@ #include "nssm.h" +#define NSSM_SOURCE _T("nssm") #define NSSM_ERROR_BUFSIZE 65535 #define NSSM_NUM_EVENT_STRINGS 16 unsigned long tls_index; @@ -42,7 +43,7 @@ void log_event(unsigned short type, unsigned long id, ...) { TCHAR *strings[NSSM_NUM_EVENT_STRINGS]; /* Open event log */ - HANDLE handle = RegisterEventSource(0, NSSM); + HANDLE handle = RegisterEventSource(0, NSSM_SOURCE); if (! handle) return; /* Log it */ @@ -80,7 +81,7 @@ int popup_message(HWND owner, unsigned int type, unsigned long id, ...) { return MessageBox(0, _T("The message which was supposed to go here is missing!"), NSSM, MB_OK | MB_ICONEXCLAMATION); } - TCHAR blurb[1024]; + TCHAR blurb[NSSM_ERROR_BUFSIZE]; va_start(arg, id); if (_vsntprintf_s(blurb, _countof(blurb), _TRUNCATE, format, arg) < 0) { va_end(arg);