mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 05:50:06 +01:00
core, impl: drop const qualifier from split outputs
We write into the buffer returned by nm_strsplit_set_full(), even though it is returned as `const char**`. The function description claims this is fine: > * It is however safe and allowed to modify the individual strings in-place, > * like "g_strstrip((char *) iter[0])". Remove the const qualifier via cast so that it does not raise errors.
This commit is contained in:
parent
754b87e1c4
commit
ac427b25fb
2 changed files with 11 additions and 11 deletions
|
|
@ -32,11 +32,11 @@ ip4_process_dhcpcd_rfc3442_routes(const char *iface,
|
||||||
in_addr_t address,
|
in_addr_t address,
|
||||||
guint32 *out_gwaddr)
|
guint32 *out_gwaddr)
|
||||||
{
|
{
|
||||||
gs_free const char **routes = NULL;
|
gs_free char **routes = NULL;
|
||||||
const char **r;
|
char **r;
|
||||||
gboolean have_routes = FALSE;
|
gboolean have_routes = FALSE;
|
||||||
|
|
||||||
routes = nm_strsplit_set(str, " ");
|
routes = (char **) nm_strsplit_set(str, " ");
|
||||||
if (!routes)
|
if (!routes)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ NMBridgeVlan *
|
||||||
nm_bridge_vlan_from_str(const char *str, GError **error)
|
nm_bridge_vlan_from_str(const char *str, GError **error)
|
||||||
{
|
{
|
||||||
NMBridgeVlan *vlan = NULL;
|
NMBridgeVlan *vlan = NULL;
|
||||||
gs_free const char **tokens = NULL;
|
gs_free char **tokens = NULL;
|
||||||
guint i, vid_start, vid_end = 0;
|
guint i, vid_start, vid_end = 0;
|
||||||
gboolean pvid = FALSE;
|
gboolean pvid = FALSE;
|
||||||
gboolean untagged = FALSE;
|
gboolean untagged = FALSE;
|
||||||
|
|
@ -482,7 +482,7 @@ nm_bridge_vlan_from_str(const char *str, GError **error)
|
||||||
g_return_val_if_fail(str, NULL);
|
g_return_val_if_fail(str, NULL);
|
||||||
g_return_val_if_fail(!error || !*error, NULL);
|
g_return_val_if_fail(!error || !*error, NULL);
|
||||||
|
|
||||||
tokens = nm_utils_escaped_tokens_split(str, NM_ASCII_SPACES);
|
tokens = (char **) nm_utils_escaped_tokens_split(str, NM_ASCII_SPACES);
|
||||||
if (!tokens || !tokens[0]) {
|
if (!tokens || !tokens[0]) {
|
||||||
g_set_error_literal(error,
|
g_set_error_literal(error,
|
||||||
NM_CONNECTION_ERROR,
|
NM_CONNECTION_ERROR,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue