X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=sidebyside;f=event.cpp;h=6744da2fc895e019e6f5616f83df7bc4279b1767;hb=2c60e5334f6df07bf42e7a91cf59638453eca473;hp=bd06363d53e47fd68cc0003f112d3e20d3dce8d0;hpb=5b9e64a9ae1fbf1254c9c246e5b123d3aa77a37a;p=nssm.git diff --git a/event.cpp b/event.cpp index bd06363..6744da2 100644 --- a/event.cpp +++ b/event.cpp @@ -73,15 +73,15 @@ int popup_message(unsigned int type, unsigned long id, ...) { TCHAR *format = message_string(id); if (! format) { - return MessageBox(0, _T("Message %lu was supposed to go here!"), NSSM, MB_OK | MB_ICONEXCLAMATION); + return MessageBox(0, _T("The message which was supposed to go here is missing!"), NSSM, MB_OK | MB_ICONEXCLAMATION); } - TCHAR blurb[256]; + TCHAR blurb[512]; va_start(arg, id); - if (_vsntprintf_s(blurb, sizeof(blurb), _TRUNCATE, format, arg) < 0) { + if (_vsntprintf_s(blurb, _countof(blurb), _TRUNCATE, format, arg) < 0) { va_end(arg); LocalFree(format); - return MessageBox(0, _T("Message %lu was supposed to go here!"), NSSM, MB_OK | MB_ICONEXCLAMATION); + return MessageBox(0, _T("the message which was supposed to go here is too big!"), NSSM, MB_OK | MB_ICONEXCLAMATION); } va_end(arg);