From 11fe0107f4dc506c503e0d443d0698c6b5e77c41 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 16 Dec 2006 15:56:26 +0000 Subject: [PATCH] it makes no sense allocating an array and then asiging it to a fixed string ... this caused stuff to crash badly as long error strings were assigned. git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@929 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_not_thread_safe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program/src/rrd_not_thread_safe.c b/program/src/rrd_not_thread_safe.c index 2d3b3503..70222770 100644 --- a/program/src/rrd_not_thread_safe.c +++ b/program/src/rrd_not_thread_safe.c @@ -14,20 +14,20 @@ #define MAXLEN 4096 #define ERRBUFLEN 256 -static char rrd_error[MAXLEN] = "\0"; -static char rrd_liberror[ERRBUFLEN] = "\0"; +static char rrd_error[MAXLEN+10]; +static char rrd_liberror[ERRBUFLEN+10]; /* The global context is very useful in the transition period to even more thread-safe stuff, it can be used whereever we need a context and do not need to worry about concurrency. */ static struct rrd_context global_ctx = { - sizeof(rrd_error), - sizeof(rrd_liberror), + MAXLEN, + ERRBUFLEN, rrd_error, rrd_liberror }; -#include +/* #include */ -struct rrd_context *rrd_get_context() { +struct rrd_context *rrd_get_context(void) { return &global_ctx; } -- 2.30.2