From b1765a11a84b503c3218d311aa666786b5540480 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 8 Sep 2006 17:25:03 +0000 Subject: [PATCH] escaping hash keys git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@783 9efc2488-bf62-4759-914b-345cdb29e865 --- src/objson/object.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/objson/object.c b/src/objson/object.c index cdd4a4b..c781c30 100644 --- a/src/objson/object.c +++ b/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