- IL_ERR_MSG_LEN = 1024
authorAleš Křenek <ljocha@ics.muni.cz>
Thu, 30 Nov 2006 11:04:32 +0000 (11:04 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Thu, 30 Nov 2006 11:04:32 +0000 (11:04 +0000)
- always terminate the error string to aviod appending garbage

org.glite.lb.logger/src/il_error.c

index 95bee1b..a13af21 100644 (file)
@@ -20,7 +20,7 @@ extern int log_level;
 
 static pthread_key_t err_key;
 
-static int IL_ERR_MSG_LEN = 128;
+static int IL_ERR_MSG_LEN = 1024;
 
 static
 void
@@ -133,6 +133,8 @@ set_error(int code, long minor, char *msg)
          strncpy(err->msg, msg, IL_ERR_MSG_LEN);
   }
 
+  err->msg[IL_ERR_MSG_LEN] = 0; /* OK, malloc()ed IL_ERR_MSG_LEN + 1 */
+
   return(code);
 }