summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f74d29c)
raw | patch | inline | side by side (parent: f74d29c)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 8 Sep 2010 12:15:13 +0000 (12:15 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 8 Sep 2010 12:15:13 +0000 (12:15 +0000) |
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
the original version never restored the locale since it held a copy of the
new locale and not the old one despite the name. bug found by Pawe? 'Reef' Polewicz
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2127 a5681a0c-68f1-0310-ab6d-d61299d08faa
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
the original version never restored the locale since it held a copy of the
new locale and not the old one despite the name. bug found by Pawe? 'Reef' Polewicz
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2127 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_create.c | patch | blob | history | |
src/rrd_dump.c | patch | blob | history | |
src/rrd_graph.c | patch | blob | history | |
src/rrd_rpncalc.c | patch | blob | history | |
src/rrd_tool.c | patch | blob | history | |
src/rrd_tune.c | patch | blob | history | |
src/rrd_update.c | patch | blob | history |
diff --git a/src/rrd_create.c b/src/rrd_create.c
index 99b84750f7809d15e7a4145b555a2ac29b4f8225..4a5e67f01f0bff86d8e7c643973f289214326d5c 100644 (file)
--- a/src/rrd_create.c
+++ b/src/rrd_create.c
&(rrd -> ds_def[ds_idx].par[DS_mrhb_cnt].u_cnt),
minstr,maxstr);
*/
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
if (sscanf(def, "%lu:%18[^:]:%18[^:]",
&(rrd->ds_def[ds_idx].par[DS_mrhb_cnt].u_cnt),
minstr, maxstr) == 3) {
diff --git a/src/rrd_dump.c b/src/rrd_dump.c
index f175310d2a59df1677b6deffe547bf95c03c45f4..48e339ba83a02264339483e723b49314b77f8105 100644 (file)
--- a/src/rrd_dump.c
+++ b/src/rrd_dump.c
return (-1);
}
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
if (opt_header == 1) {
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 66db17134892aae338b5ebdbb645efdcc5e3c230..f43e9ada15026eac6bf9e5ea30e6c942bedf1489 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
char *old_locale;
rrd_graph_init(&im);
/* a dummy surface so that we can measure text sizes for placements */
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
rrd_graph_options(argc, argv, &im);
if (rrd_test_error()) {
rrd_info_free(im.grinfo);
diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c
index f27fcb7c4f894d54264d063b5a47d9082b31d16e..472184c2cbbf436dfa904658a6dd85af312373e3 100644 (file)
--- a/src/rrd_rpncalc.c
+++ b/src/rrd_rpncalc.c
char vname[MAX_VNAME_LEN + 10];
char *old_locale;
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
rpnp = NULL;
expr = (char *) expr_const;
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index 2c32a35235cadecc40d386d25364f56a224ed6cd..b1a9b046965e5f5a8dc6e36849991c49bed16c51 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
if (rrd_xport
(argc - 1, &argv[1], &xxsize, &start, &end, &step, &col_cnt,
&legend_v, &data) != -1) {
- char *old_locale = setlocale(LC_NUMERIC, "C");
+ char *old_locale = setlocale(LC_NUMERIC,NULL);
+ setlocale(LC_NUMERIC, "C");
row_cnt = (end - start) / step;
ptr = data;
printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n\n",
diff --git a/src/rrd_tune.c b/src/rrd_tune.c
index f14ebc561c4a78c8455865be2efb7410c90abfa8..d42a0c06b7a3f0f0f0de94eec57e53eaa65353ba 100644 (file)
--- a/src/rrd_tune.c
+++ b/src/rrd_tune.c
optcnt++;
switch (opt) {
case 'h':
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
if ((matches =
sscanf(optarg, DS_NAM_FMT ":%ld", ds_nam,
&heartbeat)) != 2) {
break;
case 'i':
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
if ((matches =
sscanf(optarg, DS_NAM_FMT ":%lf", ds_nam, &min)) < 1) {
rrd_set_error("invalid arguments for minimum ds value");
break;
case 'a':
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
if ((matches =
sscanf(optarg, DS_NAM_FMT ":%lf", ds_nam, &max)) < 1) {
rrd_set_error("invalid arguments for maximum ds value");
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 64ddaee43ea8136fb83b0e483844f5725818abb3..150b8d0b207c733c2e3e37b009b69f2ac12bf91e 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
*current_time = tmp_time.tv_sec;
*current_time_usec = tmp_time.tv_usec;
} else {
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
tmp = strtod(updvals[0], 0);
if (errno > 0) {
}
break;
case DST_ABSOLUTE:
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
pdp_new[ds_idx] = strtod(updvals[ds_idx + 1], &endptr);
if (errno > 0) {
rate = pdp_new[ds_idx] / interval;
break;
case DST_GAUGE:
- old_locale = setlocale(LC_NUMERIC, "C");
+ old_locale = setlocale(LC_NUMERIC, NULL);
+ setlocale(LC_NUMERIC, "C");
errno = 0;
pdp_new[ds_idx] =
strtod(updvals[ds_idx + 1], &endptr) * interval;