summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0fee7b)
raw | patch | inline | side by side (parent: e0fee7b)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 22 Feb 2012 10:27:42 +0000 (10:27 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 22 Feb 2012 10:27:42 +0000 (10:27 +0000) |
program/src/rrd_xport.c | patch | blob | history |
index 4a7b688b78c938a25c3f8c158773a6bc664582dd..a0dd9e7746175fc18dcba87d8f5f0a985d3b20be 100644 (file)
--- a/program/src/rrd_xport.c
+++ b/program/src/rrd_xport.c
****************************************************************************/
#include <sys/stat.h>
+#include <locale.h>
#include "rrd_tool.h"
#include "rrd_graph.h"
info.u_cnt = im->step;
grinfo_push(im, sprintf_alloc("graph_step"), RD_I_CNT, info);
+ /* set locale */
+ char *old_locale = setlocale(LC_NUMERIC,NULL);
+ setlocale(LC_NUMERIC, "C");
/* format it for output */
int r=0;
default:
break;
}
+ /* restore locale */
+ setlocale(LC_NUMERIC, old_locale);
/* handle errors */
if (r) {
+ /* free legend */
+ for (unsigned long j = 0; j < col_cnt; j++) {
+ free(legend_v[j]);
+ }
+ free(legend_v);
+ /* free data */
+ free(data);
+ /* free the bufer */
if (buffer.data) {free(buffer.data);}
+ /* and return with error */
return r;
}
@@ -512,7 +527,7 @@ int rrd_xport_format_sv(char sep, stringbuffer_t *buffer,image_desc_t *im,time_t
localtime_r(&ti,&loc);
strftime(buf,254,timefmt,&loc);
} else {
- snprintf(buf,254,"%ul",ti);
+ snprintf(buf,254,"%lld",(long long int)ti);
}
if (addToBuffer(buffer,buf,0)) { return 1; }
/* write the columns */