diff options
author | Daniel Wagner <wagi@monom.org> | 2021-10-12 09:06:48 +0200 |
---|---|---|
committer | Daniel Wagner <wagi@monom.org> | 2021-10-15 09:02:14 +0200 |
commit | dcd775c1c5e850e784d7aa0391bf20c8609bab3d (patch) | |
tree | fcda3f26c373c6c5ca50aeaacabe6cac6e9e5b74 /gsupplicant | |
parent | 2a32ce916173f6815bd02e133ad18d7924b47aab (diff) | |
download | connman-dcd775c1c5e850e784d7aa0391bf20c8609bab3d.tar.gz |
gsupplicant: Fix error return type
clang complains with:
gsupplicant/supplicant.c:1220:10: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
return G_SUPPLICANT_MODE_UNKNOWN;
^~~~~~~~~~~~~~~~~~~~~~~~~
gsupplicant/supplicant.c:1228:10: error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
return G_SUPPLICANT_SECURITY_UNKNOWN;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Return NULL instead of the enum. In both cases the enum is 0, so there
is no change.
Diffstat (limited to 'gsupplicant')
-rw-r--r-- | gsupplicant/supplicant.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 8316f48a..470d99eb 100644 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -1217,7 +1217,7 @@ const char *g_supplicant_network_get_path(GSupplicantNetwork *network) const char *g_supplicant_network_get_mode(GSupplicantNetwork *network) { if (!network) - return G_SUPPLICANT_MODE_UNKNOWN; + return NULL; return mode2string(network->mode); } @@ -1225,7 +1225,7 @@ const char *g_supplicant_network_get_mode(GSupplicantNetwork *network) const char *g_supplicant_network_get_security(GSupplicantNetwork *network) { if (!network) - return G_SUPPLICANT_SECURITY_UNKNOWN; + return NULL; return security2string(network->security); } |