projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
its 7000 not 700 ... fix for #246 again
[rrdtool.git]
/
src
/
rrd_restore.c
diff --git
a/src/rrd_restore.c
b/src/rrd_restore.c
index
cc9b9c6
..
91545ca
100644
(file)
--- a/
src/rrd_restore.c
+++ b/
src/rrd_restore.c
@@
-1,5
+1,5
@@
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.
3
.2 Copyright by Tobi Oetiker, 1997-2009
+ * RRDtool 1.
4
.2 Copyright by Tobi Oetiker, 1997-2009
*****************************************************************************
* rrd_restore.c Contains logic to parse XML input and create an RRD file
* This file:
*****************************************************************************
* rrd_restore.c Contains logic to parse XML input and create an RRD file
* This file:
@@
-9,12
+9,15
@@
* $Id$
*************************************************************************** */
* $Id$
*************************************************************************** */
+#include "rrd_tool.h"
+#include "rrd_rpncalc.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/parser.h>
#include <libxml/xmlreader.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/parser.h>
#include <libxml/xmlreader.h>
-
+#include <locale.h>
#ifndef WIN32
# include <unistd.h> /* for off_t */
#ifndef WIN32
# include <unistd.h> /* for off_t */
@@
-30,8
+33,6
@@
# define close _close
#endif
# define close _close
#endif
-#include "rrd_tool.h"
-#include "rrd_rpncalc.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof ((a)[0]))
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof ((a)[0]))
@@
-275,21
+276,21
@@
static int get_xml_double(
double *value)
{
double *value)
{
-
c
har *text;
+
xmlC
har *text;
double temp;
double temp;
- if ((text =
(char *)
get_xml_text(reader))!= NULL){
- if (
strcasestr(text,
"nan")){
+ if ((text = get_xml_text(reader))!= NULL){
+ if (
xmlStrcasestr(text,(xmlChar *)
"nan")){
*value = DNAN;
xmlFree(text);
return 0;
}
*value = DNAN;
xmlFree(text);
return 0;
}
- else if (
strcasestr(text,
"-inf")){
+ else if (
xmlStrcasestr(text,(xmlChar *)
"-inf")){
*value = -DINF;
xmlFree(text);
return 0;
}
*value = -DINF;
xmlFree(text);
return 0;
}
- else if (
strcasestr(text,
"+inf")
- ||
strcasestr(text,
"inf")){
+ else if (
xmlStrcasestr(text,(xmlChar *)
"+inf")
+ ||
xmlStrcasestr(text,(xmlChar *)
"inf")){
*value = DINF;
xmlFree(text);
return 0;
*value = DINF;
xmlFree(text);
return 0;
@@
-1256,15
+1257,11
@@
int rrd_restore(
return (-1);
}
return (-1);
}
-#ifdef HAVE_SETLOCALE
old_locale = setlocale(LC_NUMERIC, "C");
old_locale = setlocale(LC_NUMERIC, "C");
-#endif
rrd = parse_file(argv[optind]);
rrd = parse_file(argv[optind]);
-#ifdef HAVE_SETLOCALE
setlocale(LC_NUMERIC, old_locale);
setlocale(LC_NUMERIC, old_locale);
-#endif
if (rrd == NULL)
return (-1);
if (rrd == NULL)
return (-1);