summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 148ed81)
raw | patch | inline | side by side (parent: 148ed81)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 22 May 2009 11:32:21 +0000 (11:32 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 22 May 2009 11:32:21 +0000 (11:32 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1804 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_update.c | patch | blob | history |
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 1ae36f9cc32241d03a9cdc08dccfe48dd010107b..1716a5b184d16b32ec0aff7d8ab28e47694760b7 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
*current_time_usec = tmp_time.tv_usec;
} else {
old_locale = setlocale(LC_NUMERIC, "C");
+ errno = 0;
tmp = strtod(updvals[0], 0);
+ if (errno > 0) {
+ rrd_set_error("converting '%s' to float: %s",
+ updvals[0], rrd_strerror(errno));
+ return -1;
+ };
setlocale(LC_NUMERIC, old_locale);
*current_time = floor(tmp);
*current_time_usec = (long) ((tmp - (double) *current_time) * 1e6f);
old_locale = setlocale(LC_NUMERIC, "C");
errno = 0;
pdp_new[ds_idx] = strtod(updvals[ds_idx + 1], &endptr);
- setlocale(LC_NUMERIC, old_locale);
if (errno > 0) {
rrd_set_error("converting '%s' to float: %s",
updvals[ds_idx + 1], rrd_strerror(errno));
return -1;
};
+ setlocale(LC_NUMERIC, old_locale);
if (endptr[0] != '\0') {
rrd_set_error
("conversion of '%s' to float not complete: tail '%s'",
old_locale = setlocale(LC_NUMERIC, "C");
pdp_new[ds_idx] =
strtod(updvals[ds_idx + 1], &endptr) * interval;
- setlocale(LC_NUMERIC, old_locale);
if (errno) {
rrd_set_error("converting '%s' to float: %s",
updvals[ds_idx + 1], rrd_strerror(errno));
return -1;
};
+ setlocale(LC_NUMERIC, old_locale);
if (endptr[0] != '\0') {
rrd_set_error
("conversion of '%s' to float not complete: tail '%s'",