X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_error.c;h=9f46a625df32ca8005566b81474e5f21817ca408;hb=5fc7ff89bdbced9c593c566fea9840a269935dcd;hp=acb8ff840957482481561fbeb3e6ae172f12a703;hpb=9e6db622e8756105c1322481b34650ecbe15da1a;p=rrdtool.git diff --git a/src/rrd_error.c b/src/rrd_error.c index acb8ff8..9f46a62 100644 --- a/src/rrd_error.c +++ b/src/rrd_error.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.14 Copyright by Tobi Oetiker, 1997-2006 + * RRDtool 1.2.23 Copyright by Tobi Oetiker, 1997-2007 ***************************************************************************** * rrd_error.c Common Header File ***************************************************************************** @@ -80,6 +80,7 @@ rrd_set_error_r(struct rrd_context *rrd_ctx, char *fmt, ...) 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 @@ -110,7 +111,6 @@ rrd_new_context(void) { (struct rrd_context *) malloc(sizeof(struct rrd_context)); if (rrd_ctx) { - rrd_ctx->len = 0; rrd_ctx->rrd_error = malloc(MAXLEN+10); rrd_ctx->lib_errstr = malloc(ERRBUFLEN+10); if (rrd_ctx->rrd_error && rrd_ctx->lib_errstr) {