blobmsg_json: fix \u escaping for control characters

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2013-06-21 17:06:34 +02:00
parent b9ebdbcc64
commit 7c5d2b3081

View file

@ -193,7 +193,7 @@ static void blobmsg_format_string(struct strbuf *s, const char *str)
if (escape == 'u') { if (escape == 'u') {
sprintf(buf + 4, "%02x", (unsigned char) *p); sprintf(buf + 4, "%02x", (unsigned char) *p);
len = 4; len = 6;
} else { } else {
len = 2; len = 2;
} }