index 537a5ada61f450e1b32389b9ee0f620c48877d86..89e4c32df2d2a9a54f4050f885ac04854fb68ba8 100644 (file)
--- a/program/src/rrd_error.c
+++ b/program/src/rrd_error.c
/*****************************************************************************
- * RRDtool 1.2.0 Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.30 Copyright by Tobi Oetiker, 1997-2009
*****************************************************************************
* rrd_error.c Common Header File
*****************************************************************************
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
vsnprintf((char *)rrd_ctx->rrd_error, rrd_ctx->len, fmt, argp);
+ rrd_ctx->rrd_error[rrd_ctx->len]='\0';
#else
vsprintf((char *)rrd_ctx->rrd_error, fmt, argp);
#endif
(struct rrd_context *) malloc(sizeof(struct rrd_context));
if (rrd_ctx) {
- rrd_ctx->len = 0;
- rrd_ctx->rrd_error = malloc(MAXLEN);
- rrd_ctx->lib_errstr = malloc(ERRBUFLEN);
+ rrd_ctx->rrd_error = malloc(MAXLEN+10);
+ rrd_ctx->lib_errstr = malloc(ERRBUFLEN+10);
if (rrd_ctx->rrd_error && rrd_ctx->lib_errstr) {
*rrd_ctx->rrd_error = 0;
*rrd_ctx->lib_errstr = 0;