From c1f5adbaca9e3cd974c5b3d54daa0d0a932b5823 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 8 Sep 2006 17:25:03 +0000 Subject: [PATCH 1/1] escaping hash keys git-svn-id: svn://svn.open-ils.org/ILS/trunk@6031 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/objson/object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSRF/src/objson/object.c b/OpenSRF/src/objson/object.c index cdd4a4b48a..c781c30308 100644 --- a/OpenSRF/src/objson/object.c +++ b/OpenSRF/src/objson/object.c @@ -504,7 +504,13 @@ char* jsonObjectToJSON( const jsonObject* obj ) { while( (tmp = jsonObjectIteratorNext(itr)) ) { buffer_add(buf, "\""); - buffer_add(buf, tmp->key); + + char* key = tmp->key; + int len = strlen(key); + char* output = uescape(key, len, 1); + buffer_add(buf, output); + free(output); + buffer_add(buf, "\":"); char* data = jsonObjectToJSON(tmp->item); -- 2.43.2