From 63f67ee4fb670e0a9b5fc8ddcd110e7c314597f6 Mon Sep 17 00:00:00 2001 From: Swapnil Bonde Date: Wed, 20 Jul 2016 18:34:21 +0530 Subject: [PATCH] getting error in date string 19\/07\/2016, fixed for the error 19/07/2016 --- json_object.c | 2 +- tests/test_parse.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json_object.c b/json_object.c index 24cb7ab..d4a0242 100644 --- a/json_object.c +++ b/json_object.c @@ -139,7 +139,7 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len, int fl else if(c == '\f') printbuf_memappend(pb, "\\f", 2); else if(c == '"') printbuf_memappend(pb, "\\\"", 2); else if(c == '\\') printbuf_memappend(pb, "\\\\", 2); - else if(c == '/') printbuf_memappend(pb, "\\/", 2); + else if(c == '/') printbuf_memappend(pb, "/", 1); start_offset = ++pos; break; diff --git a/tests/test_parse.c b/tests/test_parse.c index 129fc06..2d8c54b 100644 --- a/tests/test_parse.c +++ b/tests/test_parse.c @@ -226,7 +226,7 @@ struct incremental_step { { "\"\\n\"", -1, -1, json_tokener_success, 0 }, { "\"\\r\"", -1, -1, json_tokener_success, 0 }, { "\"\\t\"", -1, -1, json_tokener_success, 0 }, - { "\"\\/\"", -1, -1, json_tokener_success, 0 }, + { "\"/\"", -1, -1, json_tokener_success, 0 }, // Escaping a forward slash is optional { "\"/\"", -1, -1, json_tokener_success, 0 },