diff options
author | Thomas Haller <thaller@redhat.com> | 2018-08-26 18:21:25 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-08-26 18:34:35 +0200 |
commit | 773b419f15be11f9cf79e49f583b19792f8a4455 (patch) | |
tree | d2cdefc15f455fbb8230ce5cf7dfd82260572823 | |
parent | 2cd3d2e3d7611103e1d690020cc2ba5f1ad47fc3 (diff) |
wifi: don't use :1 bitfield for gboolean type
gboolean is a typedef for "int".
While older compilers might treat such bitfields as unsigned ([1]),
commonly such a bitfield is signed and can only contain the values 0
and -1.
We only want to use numeric 1 for TRUE, hence, creating such bitfields
is wrong, or at least error prone.
In fact, in this case it's a bug, because later we compare
it with a regular gboolean
if (priv->scanning != new_scanning)
[1] https://lgtm.com/rules/1506024027114/
Fixes: e0f96770188eeaada70a299bd6dab7a50ec34a53
(cherry picked from commit 610ca87016a71a01cf3a7ddf148270290efb7ac3)
(cherry picked from commit f326feaba3ddba91416cf02a21de5f040df95636)
(cherry picked from commit 7689b9b73bcfe10bae4924fa5b0b5253fb6759e5)
-rw-r--r-- | src/supplicant/nm-supplicant-interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c index ab8a0670e..a462fcae7 100644 --- a/src/supplicant/nm-supplicant-interface.c +++ b/src/supplicant/nm-supplicant-interface.c @@ -95,7 +95,7 @@ typedef struct { NMSupplicantInterfaceState state; int disconnect_reason; - gboolean scanning:1; + bool scanning:1; bool scan_done_pending:1; bool scan_done_success:1; |