summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Štetiar2019-11-19 16:34:25 +0000
committerPetr Štetiar2019-11-24 12:26:58 +0000
commitc008294a8323c8cd45decde6a97aa85df2443dac (patch)
treeb2f746c359abe7e344e58d7826fbab4ad497324b
parent0003ea9c45cc8d2f57af760a92a35f371649714f (diff)
downloadlibubox-c008294a8323c8cd45decde6a97aa85df2443dac.tar.gz
blobmsg_json: fix possible uninitialized struct member
clang-10 analyzer reports following: blobmsg_json.c:285:2: warning: The expression is an uninitialized value. The computed value will also be garbage s->indent_level++; ^~~~~~~~~~~~~~~~~ Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r--blobmsg_json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/blobmsg_json.c b/blobmsg_json.c
index a5980e8..1859211 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -315,7 +315,7 @@ static void setup_strbuf(struct strbuf *s, struct blob_attr *attr, blobmsg_json_
char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_json_format_t cb, void *priv, int indent)
{
- struct strbuf s;
+ struct strbuf s = {0};
bool array;
char *ret;
@@ -349,7 +349,7 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, blobmsg_jso
char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, blobmsg_json_format_t cb, void *priv, int indent)
{
- struct strbuf s;
+ struct strbuf s = {0};
char *ret;
setup_strbuf(&s, attr, cb, priv, indent);