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 },