From 0fea4857b60360bef8ef54e4b47c82f2cf060cb5 Mon Sep 17 00:00:00 2001 From: terry-xiaoyu <506895667@qq.com> Date: Wed, 17 Jun 2020 11:54:25 +0800 Subject: [PATCH] Fix \r and \n not supported in JSON value --- c_src/decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_src/decoder.c b/c_src/decoder.c index 8f78117..d41f528 100644 --- a/c_src/decoder.c +++ b/c_src/decoder.c @@ -208,7 +208,7 @@ dec_string(Decoder* d, ERL_NIF_TERM* value) st = d->i; while(d->i < d->len) { - if(d->p[d->i] < 0x20) { + if((d->p[d->i] < 0x20) && (d->p[d->i] != 10) && (d->p[d->i] != 13)) { return 0; } else if(d->p[d->i] == '\"') { d->i++;