From: oetiker Date: Tue, 20 Oct 2009 19:23:49 +0000 (+0000) Subject: set locale to C while restoring X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=82e01553bb38628caa8fc4fa7d365e7dfa39a680;p=rrdtool-all.git set locale to C while restoring git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1939 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 32bfdebc..cc9b9c65 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -1214,7 +1214,7 @@ int rrd_restore( char **argv) { rrd_t *rrd; - + char *old_locale; /* init rrd clean */ optind = 0; opterr = 0; /* initialize getopt */ @@ -1256,7 +1256,16 @@ int rrd_restore( return (-1); } +#ifdef HAVE_SETLOCALE + old_locale = setlocale(LC_NUMERIC, "C"); +#endif + rrd = parse_file(argv[optind]); + +#ifdef HAVE_SETLOCALE + setlocale(LC_NUMERIC, old_locale); +#endif + if (rrd == NULL) return (-1);