Code

fix for debian bug 359071 ... reporting the long cdef in the error message was too...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 4 May 2006 20:41:51 +0000 (20:41 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Thu, 4 May 2006 20:41:51 +0000 (20:41 +0000)
plus some other small cleanups in this context

git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@815 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/Makefile.am
src/rrd_error.c
src/rrd_restore.c
src/rrd_rpncalc.c

index dedab624cc30969268008113f11f8b341c41038e..d6b3122dd879d5e143e721772787cc3689b5f7d8 100644 (file)
@@ -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
index df675a2fbe278a636f6c3f48823d7f9289437f58..ced26b5bac6bd5dc73b6ba84b65fdee547aa84b7 100644 (file)
@@ -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;
index 51def7e465e2c16736c66310ae271c4f78d7aa63..29a97b3bf67260a946bd9ac9e950b11ebf9cd458 100644 (file)
@@ -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);
index 6a903f53974987233c2139775d4611925e9597e0..3c6510f913d1a81418b07e6e8119b5c896b2b6b3 100644 (file)
@@ -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.