From: oetiker Date: Thu, 4 May 2006 20:41:51 +0000 (+0000) Subject: fix for debian bug 359071 ... reporting the long cdef in the error message was too... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ea8c80dc3408fe93f13c99154003b63144c7cbe0;p=rrdtool-all.git fix for debian bug 359071 ... reporting the long cdef in the error message was too much ... plus some other small cleanups in this context git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@815 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/Makefile.am b/program/src/Makefile.am index dedab624..d6b3122d 100644 --- a/program/src/Makefile.am +++ b/program/src/Makefile.am @@ -99,7 +99,7 @@ librrd_la_LDFLAGS = -version-info 2:7:0 librrd_th_la_SOURCES = $(RRD_C_FILES) rrd_thread_safe.c librrd_th_la_CFLAGS = $(MULTITHREAD_CFLAGS) -librrd_th_la_LDFLAGS = $(MULTITHREAD_LDFLAGS) -version-info 2:1:0 +librrd_th_la_LDFLAGS = $(MULTITHREAD_LDFLAGS) -version-info 2:7:0 include_HEADERS = rrd.h diff --git a/program/src/rrd_error.c b/program/src/rrd_error.c index df675a2f..ced26b5b 100644 --- a/program/src/rrd_error.c +++ b/program/src/rrd_error.c @@ -111,8 +111,8 @@ rrd_new_context(void) { 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; diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 51def7e4..29a97b3b 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -191,8 +191,9 @@ int xml2rrd(char* buf, rrd_t* rrd, char rc){ read_tag(&ptr2,"max","%lf",&(rrd->ds_def[rrd->stat_head->ds_cnt-1].par[DS_max_val].u_val)); } else { /* DST_CDEF */ char buffer[1024]; - read_tag(&ptr2,"cdef","%s",buffer); + read_tag(&ptr2,"cdef","%1000s",buffer); parseCDEF_DS(buffer,rrd,rrd -> stat_head -> ds_cnt - 1); + if (rrd_test_error()) return -1; } read_tag(&ptr2,"last_ds","%30s",rrd->pdp_prep[rrd->stat_head->ds_cnt-1].last_ds); diff --git a/program/src/rrd_rpncalc.c b/program/src/rrd_rpncalc.c index 6a903f53..3c6510f9 100644 --- a/program/src/rrd_rpncalc.c +++ b/program/src/rrd_rpncalc.c @@ -194,7 +194,7 @@ void parseCDEF_DS(char *def,rrd_t *rrd, int ds_idx) rpnp = rpn_parse((void*) rrd, def, &lookup_DS); if (rpnp == NULL) { - rrd_set_error("failed to parse computed data source %s", def); + rrd_set_error("failed to parse computed data source"); return; } /* Check for OP nodes not permitted in COMPUTE DS.