aux-intern: add explicit cast for strchr()

`addr` is always reallocated in this branch, so it
is safe to cast the result of strchr to char* here
to silence the const-qualifier warning.
This commit is contained in:
Jan Vaclav 2025-12-03 09:40:57 +01:00
parent 9e70f31c8c
commit 8e72e6b4fb

View file

@ -825,7 +825,7 @@ nm_dns_uri_parse(int addr_family, const char *str, NMDnsServer *dns, GError **er
addr = nm_strndup_a(100, addr_port, end - addr_port, &addr_heap); addr = nm_strndup_a(100, addr_port, end - addr_port, &addr_heap);
/* IPv6 link-local scope-id */ /* IPv6 link-local scope-id */
perc = strchr(addr, '%'); perc = (char *) strchr(addr, '%');
if (perc) { if (perc) {
*perc = '\0'; *perc = '\0';
if (g_strlcpy(dns->interface, perc + 1, sizeof(dns->interface)) if (g_strlcpy(dns->interface, perc + 1, sizeof(dns->interface))