aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorLeon M. George <leon@georgemail.eu>2020-03-13 00:02:37 +0100
committerDaniel Golle <daniel@makrotopia.org>2020-03-17 10:23:28 +0100
commitb78f61c336542a3658c3b1c595b3bb2810f93500 (patch)
treebd8c7d4bbcab43c5af3eda73b0b3fe735e710fae /package/network
parenta8a993e64c4ee8de61e0e56ddad7ecf7af24c787 (diff)
downloadupstream-b78f61c336542a3658c3b1c595b3bb2810f93500.tar.gz
upstream-b78f61c336542a3658c3b1c595b3bb2810f93500.tar.bz2
upstream-b78f61c336542a3658c3b1c595b3bb2810f93500.zip
hostapd: fix pointer cast warnings
Signed-off-by: Leon M. George <leon@georgemail.eu>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/hostapd/src/src/ap/ubus.c11
-rw-r--r--package/network/services/hostapd/src/wpa_supplicant/ubus.c12
2 files changed, 15 insertions, 8 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index 5f66b5e92b..988cc70113 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -1110,6 +1110,7 @@ static struct ubus_object_type daemon_object_type =
void hostapd_ubus_add(struct hapd_interfaces *interfaces)
{
struct ubus_object *obj = &interfaces->ubus;
+ char *name;
int name_len;
int ret;
@@ -1119,12 +1120,14 @@ void hostapd_ubus_add(struct hapd_interfaces *interfaces)
name_len = strlen("hostapd") + 1;
if (interfaces->name)
name_len += strlen(interfaces->name) + 1;
- obj->name = malloc(name_len);
- strcpy(obj->name, "hostapd");
+
+ name = malloc(name_len);
+ strcpy(name, "hostapd");
if (interfaces->name) {
- strcat(obj->name, ".");
- strcat(obj->name, interfaces->name);
+ strcat(name, ".");
+ strcat(name, interfaces->name);
}
+ obj->name = name;
obj->type = &daemon_object_type;
obj->methods = daemon_object_type.methods;
diff --git a/package/network/services/hostapd/src/wpa_supplicant/ubus.c b/package/network/services/hostapd/src/wpa_supplicant/ubus.c
index 9a98979e9a..4a4e4697b9 100644
--- a/package/network/services/hostapd/src/wpa_supplicant/ubus.c
+++ b/package/network/services/hostapd/src/wpa_supplicant/ubus.c
@@ -320,6 +320,7 @@ static struct ubus_object_type wpas_daemon_object_type =
void wpas_ubus_add(struct wpa_global *global)
{
struct ubus_object *obj = &global->ubus_global;
+ char *name;
int name_len;
int ret;
@@ -329,15 +330,18 @@ void wpas_ubus_add(struct wpa_global *global)
name_len = strlen("wpa_supplicant") + 1;
if (global->params.name)
name_len += strlen(global->params.name) + 1;
- obj->name = malloc(name_len);
- strcpy(obj->name, "wpa_supplicant");
+
+ name = malloc(name_len);
+ strcpy(name, "wpa_supplicant");
if (global->params.name)
{
- strcat(obj->name, ".");
- strcat(obj->name, global->params.name);
+ strcat(name, ".");
+ strcat(name, global->params.name);
}
+ obj->name = name;
+
obj->type = &wpas_daemon_object_type;
obj->methods = wpas_daemon_object_type.methods;
obj->n_methods = wpas_daemon_object_type.n_methods;