X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=blobmsg_json.c;h=f16635834fb9ccc53ba76515dd08e4f04ab4e2f2;hp=f629d76edae032177f843675d93d21652f761ad7;hb=d01922625d21f97fcab757d0299586178333f1e0;hpb=76f584c7612dc5ac8090da19b50ab159cb5c586a diff --git a/blobmsg_json.c b/blobmsg_json.c index f629d76..f166358 100644 --- a/blobmsg_json.c +++ b/blobmsg_json.c @@ -108,7 +108,7 @@ static bool blobmsg_puts(struct strbuf *s, const char *c, int len) return true; if (s->pos + len >= s->len) { - s->len += 16; + s->len += 16 + len; s->buf = realloc(s->buf, s->len); if (!s->buf) return false; @@ -228,6 +228,9 @@ static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, boo data_str = buf; switch(blob_id(attr)) { + case BLOBMSG_TYPE_UNSPEC: + sprintf(buf, "null"); + break; case BLOBMSG_TYPE_BOOL: sprintf(buf, "%s", *(uint8_t *)data ? "true" : "false"); break;