fix a few format string bugs
authorFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 21:34:24 +0000 (23:34 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 21:34:24 +0000 (23:34 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ubus.c

diff --git a/ubus.c b/ubus.c
index 6d0cdeaa4c0496a42257dcf3387b3ecc1bc29374..efd6cb106e19ea086fa834d4e4f95741fec61ac6 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -59,7 +59,7 @@ mdns_browse(struct ubus_context *ctx, struct ubus_object *obj,
                char *local;
                if (*((char *) s->avl.key) != '_')
                        continue;
-               snprintf(buffer, MAX_NAME_LEN, s->avl.key);
+               snprintf(buffer, MAX_NAME_LEN, "%s", (const char *) s->avl.key);
                local = strstr(buffer, ".local");
                if (local)
                        *local = '\0';
@@ -69,7 +69,7 @@ mdns_browse(struct ubus_context *ctx, struct ubus_object *obj,
                if (!c1) {
                        c1 = blobmsg_open_table(&b, buffer);
                }
-               snprintf(buffer, MAX_NAME_LEN, s->entry);
+               snprintf(buffer, MAX_NAME_LEN, "%s", (const char *) s->entry);
                local = strstr(buffer, "._");
                if (local)
                        *local = '\0';
@@ -103,7 +103,7 @@ mdns_hosts(struct ubus_context *ctx, struct ubus_object *obj,
                char *local;
                if (*((char *) s->avl.key) == '_')
                        continue;
-               snprintf(buffer, MAX_NAME_LEN, s->entry);
+               snprintf(buffer, MAX_NAME_LEN, "%s", (const char *) s->entry);
                local = strstr(buffer, "._");
                if (local)
                        *local = '\0';