From: Aleš Křenek Date: Thu, 30 Nov 2006 11:04:32 +0000 (+0000) Subject: - IL_ERR_MSG_LEN = 1024 X-Git-Tag: glite-lb-logger_R_1_2_3~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=ff0fffae767a230219af385ef75b7c7712f0bed0;p=jra1mw.git - IL_ERR_MSG_LEN = 1024 - always terminate the error string to aviod appending garbage --- diff --git a/org.glite.lb.logger/src/il_error.c b/org.glite.lb.logger/src/il_error.c index 95bee1b..a13af21 100644 --- a/org.glite.lb.logger/src/il_error.c +++ b/org.glite.lb.logger/src/il_error.c @@ -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); }