summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00b82fd)
raw | patch | inline | side by side (parent: 00b82fd)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 16 Dec 2006 15:56:26 +0000 (15:56 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 16 Dec 2006 15:56:26 +0000 (15:56 +0000) |
this caused stuff to crash badly as long error strings were assigned.
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@929 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@929 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_not_thread_safe.c | patch | blob | history |
index 2d3b35033d1406c111aa12d5cbc30f29fd9a3f22..7022277064639a2ed84a3df707e462957dbfd5b5 100644 (file)
#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 <stdarg.h>
+/* #include <stdarg.h> */
-struct rrd_context *rrd_get_context() {
+struct rrd_context *rrd_get_context(void) {
return &global_ctx;
}