/*****************************************************************************
- * RRDtool 1.2.15 Copyright by Tobi Oetiker, 1997-2006
+ * RRDtool 1.2.19 Copyright by Tobi Oetiker, 1997-2007
*****************************************************************************
* rrd_update.c RRD Update Function
*****************************************************************************
dst_idx= dst_conv(rrd.ds_def[i].dst);
/* make sure we do not build diffs with old last_ds values */
- if(rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt < interval
- && ( dst_idx == DST_COUNTER || dst_idx == DST_DERIVE)){
+ if(rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt < interval) {
strncpy(rrd.pdp_prep[i].last_ds,"U",LAST_DS_LEN-1);
rrd.pdp_prep[i].last_ds[LAST_DS_LEN-1]='\0';
}
case DST_DERIVE:
if(rrd.pdp_prep[i].last_ds[0] != 'U'){
for(ii=0;updvals[i+1][ii] != '\0';ii++){
- if(updvals[i+1][ii] < '0' || updvals[i+1][ii] > '9' || (ii==0 && updvals[i+1][ii] == '-')){
+ if((updvals[i+1][ii] < '0' || updvals[i+1][ii] > '9') && (ii != 0 && updvals[i+1][ii] != '-')){
rrd_set_error("not a simple integer: '%s'",updvals[i+1]);
break;
}
rrd.pdp_prep[i].last_ds,
updvals[i+1], pdp_new[i]);
#endif
- if(dst_idx == DST_COUNTER || dst_idx == DST_DERIVE){
- strncpy(rrd.pdp_prep[i].last_ds,
- updvals[i+1],LAST_DS_LEN-1);
- rrd.pdp_prep[i].last_ds[LAST_DS_LEN-1]='\0';
- }
+ strncpy(rrd.pdp_prep[i].last_ds, updvals[i+1],LAST_DS_LEN-1);
+ rrd.pdp_prep[i].last_ds[LAST_DS_LEN-1]='\0';
}
/* break out of the argument parsing loop if the error_string is set */
if (rrd_test_error()){