fixed 2. x-grid example ... since the lable is valid for the whole day, it must be...
[rrdtool.git] / src / rrd_update.c
index b3cc86c..c5bd1bf 100644 (file)
@@ -1745,8 +1745,14 @@ static rrd_value_t calculate_cdp_val(
     rrd_value_t pdp_temp_val,
     unsigned long elapsed_pdp_st,
     int current_cf,
+#ifdef DEBUG
     int i,
-    int ii)
+    int ii
+#else
+    int UNUSED(i),
+    int UNUSED(ii)
+#endif
+)
 {
     if (isnan(cdp_val)) {
         if (current_cf == CF_AVERAGE) {
@@ -1963,7 +1969,7 @@ static int write_RRA_row(
                 rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val,
                 rrd_file->pos, rrd->rra_def[rra_idx].cf_nam);
 #endif
-        if (pcdp_summary != NULL) {
+        if (*pcdp_summary != NULL) {
             iv.u_val = rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val;
             /* append info to the return hash */
             *pcdp_summary = info_push(*pcdp_summary,