From ff0fffae767a230219af385ef75b7c7712f0bed0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 30 Nov 2006 11:04:32 +0000 Subject: [PATCH] - IL_ERR_MSG_LEN = 1024 - always terminate the error string to aviod appending garbage --- org.glite.lb.logger/src/il_error.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 1.8.2.3