if ((fmt != 00) && (p_event_mgr != 00)) {
va_list arg;
- size_t str_length/*, i, j*/; /* UniPG */
char message[OPJ_MSG_SIZE];
memset(message, 0, OPJ_MSG_SIZE);
/* initialize the optional parameter list */
va_start(arg, fmt);
- /* check the length of the format string */
- str_length = (strlen(fmt) > OPJ_MSG_SIZE) ? OPJ_MSG_SIZE : strlen(fmt);
- (void)str_length;
/* parse the format string and put the result in 'message' */
- vsnprintf(message, OPJ_MSG_SIZE, fmt, arg); /* UniPG */
+ vsnprintf(message, OPJ_MSG_SIZE, fmt, arg);
+ /* force zero termination for Windows _vsnprintf() of old MSVC */
+ message[OPJ_MSG_SIZE - 1] = '\0';
/* deinitialize the optional parameter list */
va_end(arg);