summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'json.c')
-rw-r--r--json.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/json.c b/json.c
index 27f39a28..9b441dd7 100644
--- a/json.c
+++ b/json.c
@@ -56,6 +56,7 @@ PERMISSIONS
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <locale.h>
#include "gpsd_config.h" /* for strlcpy() prototype */
#include "json.h"
@@ -555,8 +556,14 @@ int json_read_array(const char *cp, const struct json_array_t *arr,
int json_read_object(const char *cp, const struct json_attr_t *attrs,
/*@null@*/ const char **end)
{
+ char *savedlocale = setlocale(LC_ALL, NULL);
+ int st;
+
+ setlocale(LC_ALL, "C");
json_debug_trace((1, "json_read_object() sees '%s'\n", cp));
- return json_internal_read_object(cp, attrs, NULL, 0, end);
+ st = json_internal_read_object(cp, attrs, NULL, 0, end);
+ setlocale(LC_ALL, savedlocale);
+ return st;
}
const /*@observer@*/ char *json_error_string(int err)