[trunk] updated copyright and added copyright notice required by ISO, in each file...
[openjpeg.git] / src / lib / openjp2 / event.c
index d23907ddc3521661e4c44a0840ea66675b0e5f0d..b6034b42d0a3cf3ed6c173a90afae61a0d09be99 100644 (file)
@@ -1,6 +1,11 @@
 /*
+ * The copyright in this software is being made available under the 2-clauses 
+ * BSD License, included below. This software may be subject to other third 
+ * party and contributor rights, including patent rights, and no such rights
+ * are granted under this license.
+ *
  * Copyright (c) 2005, Herve Drolon, FreeImage Team
- * Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France 
+ * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR 
  * Copyright (c) 2012, CS Systemes d'Information, France
  * All rights reserved.
  *
@@ -78,8 +83,8 @@ static void opj_default_callback (const char *msg, void *client_data)
 
 
 /* ----------------------------------------------------------------------- */
-OPJ_BOOL opj_event_msg(opj_event_mgr_t* p_event_mgr, int event_type, const char *fmt, ...) {
-#define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
+OPJ_BOOL opj_event_msg(opj_event_mgr_t* p_event_mgr, OPJ_INT32 event_type, const char *fmt, ...) {
+#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
        opj_msg_callback msg_handler = 00;
        void * l_data = 00;
 
@@ -110,15 +115,15 @@ OPJ_BOOL opj_event_msg(opj_event_mgr_t* p_event_mgr, int event_type, const char
        if ((fmt != 00) && (p_event_mgr != 00)) {
                va_list arg;
                size_t str_length/*, i, j*/; /* UniPG */
-               char message[MSG_SIZE];
-               memset(message, 0, MSG_SIZE);
+               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) > MSG_SIZE) ? MSG_SIZE : strlen(fmt);
+               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' */
-               vsprintf(message, fmt, arg); /* UniPG */
+               vsnprintf(message, OPJ_MSG_SIZE, fmt, arg); /* UniPG */
                /* deinitialize the optional parameter list */
                va_end(arg);