Browse Source

getting error in date string 19\/07\/2016, fixed for the error 19/07/2016

pull/241/head
Swapnil Bonde 9 years ago
parent
commit
63f67ee4fb
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      json_object.c
  2. +1
    -1
      tests/test_parse.c

+ 1
- 1
json_object.c View File

@@ -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;


+ 1
- 1
tests/test_parse.c View File

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



Loading…
Cancel
Save