#include "nssm.h"\r
\r
#define NSSM_ERROR_BUFSIZE 65535\r
+#define NSSM_NUM_EVENT_STRINGS 16\r
unsigned long tls_index;\r
\r
/* Convert error code to error string - must call LocalFree() on return value */\r
va_list arg;\r
int count;\r
char *s;\r
- char *strings[6];\r
+ char *strings[NSSM_NUM_EVENT_STRINGS];\r
\r
/* Open event log */\r
HANDLE handle = RegisterEventSource(0, TEXT(NSSM));\r
/* Log it */\r
count = 0;\r
va_start(arg, id);\r
- while ((s = va_arg(arg, char *))) strings[count++] = s;\r
+ while ((s = va_arg(arg, char *)) && count < NSSM_NUM_EVENT_STRINGS - 1) strings[count++] = s;\r
+ strings[count] = 0;\r
va_end(arg);\r
ReportEvent(handle, type, 0, id, 0, count, 0, (const char **) strings, 0);\r
\r