examples: fix build error
authorLuka Perkov <luka@openwrt.org>
Thu, 3 Jul 2014 11:46:24 +0000 (13:46 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 3 Jul 2014 11:48:30 +0000 (13:48 +0200)
Patch fixes the following error:

error: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘void *’ [-Werror=format=]
   indent_printf(indent, "%s\n", blobmsg_data(data));

Signed-off-by: Luka Perkov <luka@openwrt.org>
examples/blobmsg-example.c

index d306f0707433db9c2f827b560b64a19ee202e385..6330fea33095fdf9dfcbd87eee6dbd8e78fa6485 100644 (file)
@@ -34,7 +34,7 @@ static void dump_attr_data(struct blob_attr *data, int indent, int next_indent)
        int type = blobmsg_type(data);
        switch(type) {
        case BLOBMSG_TYPE_STRING:
-               indent_printf(indent, "%s\n", blobmsg_data(data));
+               indent_printf(indent, "%s\n", (char *) blobmsg_data(data));
                break;
        case BLOBMSG_TYPE_INT8:
                indent_printf(indent, "%d\n", blobmsg_get_u8(data));