diff --git a/json_object.c b/json_object.c index 7f085f3..4c4d04b 100644 --- a/json_object.c +++ b/json_object.c @@ -110,7 +110,7 @@ static int json_escape_str(struct printbuf *pb, const char *str, int len) { int pos = 0, start_offset = 0; unsigned char c; - while (len--) + while (pos < len) { c = str[pos]; switch(c)