Skip to contentSkip to conversation

mesh: don't incorrectly use const

PATCH In review Rudi Heitbaum 2 participants 2 messages Feb 8 – Feb 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mesh: don't incorrectly use const

*name is used by strchr and subsequently modified replacing "=" with '\0'. Remove incorrect and unnecessary const. Passed in argv[] is editable, and is being modified in the function.

Fixes:
mesh.c: In function 'set_interface_meshparam':
mesh.c:327:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
327 | value = strchr(name, '=');
| ^

---
 mesh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mesh.c +1 -1
index 40e5e5e..f116ae7 100644
@@ -317,7 +317,7 @@ static int set_interface_meshparam(struct nl80211_state *state,
 	}
 
 	while (argc) {
-		const char *name;
+		char *name;
 		char *value;
 		_any any;
 
Signature · 1 line
2.51.0
#1 lore raw

mesh.c

Quoted 3 lines · Rudi Heitbaum
mesh.c +0 -0

What's this for? Maybe 'iw'? Please use (also) that for subject prefix if so.

johannes