fix handling of values <= zero for logarithmic display
[rrdtool.git] / src / rrd_dump.c
index baf560c..7ad85b2 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2.99907080300  Copyright by Tobi Oetiker, 1997-2007
+ * RRDtool 1.3rc2  Copyright by Tobi Oetiker, 1997-2008
  *****************************************************************************
  * rrd_dump  Display a RRD
  *****************************************************************************
@@ -98,6 +98,10 @@ int rrd_dump_r(
         out_file = stdout;
     }
 
+    fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>", out_file);
+    fputs
+        ("<!DOCTYPE rrd SYSTEM \"http://oss.oetiker.ch/rrdtool/rrdtool.dtd\">",
+         out_file);
     fputs("<!-- Round Robin Database Dump -->", out_file);
     fputs("<rrd>", out_file);
     if (atoi(rrd.stat_head->version) <= 3) {
@@ -113,8 +117,8 @@ int rrd_dump_r(
 #else
 # error "Need strftime"
 #endif
-    fprintf(out_file, "\t<lastupdate> %ld </lastupdate> <!-- %s -->\n\n",
-            rrd.live_head->last_up, somestring);
+    fprintf(out_file, "\t<lastupdate> %lu </lastupdate> <!-- %s -->\n\n",
+            (unsigned long) rrd.live_head->last_up, somestring);
     for (i = 0; i < rrd.stat_head->ds_cnt; i++) {
         fprintf(out_file, "\t<ds>\n");
         fprintf(out_file, "\t\t<name> %s </name>\n", rrd.ds_def[i].ds_nam);