unsigned long tls_index;\r
\r
/* Convert error code to error string - must call LocalFree() on return value */\r
unsigned long tls_index;\r
\r
/* Convert error code to error string - must call LocalFree() on return value */\r
}\r
\r
if (! FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) error_message, NSSM_ERROR_BUFSIZE, 0)) {\r
}\r
\r
if (! FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) error_message, NSSM_ERROR_BUFSIZE, 0)) {\r
- if (_snprintf(error_message, NSSM_ERROR_BUFSIZE, "system error %lu", error) < 0) return 0;\r
+ if (_snprintf_s(error_message, NSSM_ERROR_BUFSIZE, _TRUNCATE, "system error %lu", error) < 0) return 0;\r
char *ret;\r
if (! FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &ret, NSSM_ERROR_BUFSIZE, 0)) {\r
ret = (char *) HeapAlloc(GetProcessHeap(), 0, 32);\r
char *ret;\r
if (! FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, 0, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &ret, NSSM_ERROR_BUFSIZE, 0)) {\r
ret = (char *) HeapAlloc(GetProcessHeap(), 0, 32);\r
- if (_snprintf(ret, NSSM_ERROR_BUFSIZE, "system error %lu", error) < 0) return 0;\r
+ if (_snprintf_s(ret, NSSM_ERROR_BUFSIZE, _TRUNCATE, "system error %lu", error) < 0) return 0;\r
va_end(arg);\r
ReportEvent(handle, type, 0, id, 0, count, 0, (const char **) strings, 0);\r
\r
va_end(arg);\r
ReportEvent(handle, type, 0, id, 0, count, 0, (const char **) strings, 0);\r
\r
- if (vsnprintf(blurb, sizeof(blurb), format, arg) < 0) {\r
+ if (vsnprintf_s(blurb, sizeof(blurb), _TRUNCATE, format, arg) < 0) {\r
va_end(arg);\r
LocalFree(format);\r
return MessageBox(0, "Message %lu was supposed to go here!", NSSM, MB_OK | MB_ICONEXCLAMATION);\r
va_end(arg);\r
LocalFree(format);\r
return MessageBox(0, "Message %lu was supposed to go here!", NSSM, MB_OK | MB_ICONEXCLAMATION);\r