mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	hostapd: fix pointer cast warnings
Signed-off-by: Leon M. George <leon@georgemail.eu>
This commit is contained in:
		
							parent
							
								
									a8a993e64c
								
							
						
					
					
						commit
						b78f61c336
					
				@ -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;
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user