diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-02-15 17:42:25 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-02-15 18:17:18 +0100 |
commit | 5a7d20a6a23961f316e1195050fa09bab97a52d3 (patch) | |
tree | 3211e473cef57f49630fd85747eba21c8f0bf02a /src | |
parent | 82d9bd7499973ee75e78108f10cbafabc3ce62f7 (diff) |
qmicli,helpers: make sure flags are reset before parsing the string
We OR each flag value found in the output directly, so make sure that
output is clear before adding any new flag.
Reported-by: Paul Gildea <gildeap@tcd.ie>
Diffstat (limited to 'src')
-rw-r--r-- | src/qmicli/qmicli-helpers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmicli/qmicli-helpers.c b/src/qmicli/qmicli-helpers.c index 2a2dad2..46e17db 100644 --- a/src/qmicli/qmicli-helpers.c +++ b/src/qmicli/qmicli-helpers.c @@ -237,6 +237,8 @@ qmicli_read_rat_mode_pref_from_string (const gchar *str, type = qmi_nas_rat_mode_preference_get_type (); flags_class = G_FLAGS_CLASS (g_type_class_ref (type)); + *out = 0; + items = g_strsplit_set (str, "|", 0); for (iter = items; iter && *iter && success; iter++) { if (!*iter[0]) @@ -451,6 +453,8 @@ qmicli_read_net_open_flags_from_string (const gchar *str, type = qmi_device_open_flags_get_type (); flags_class = G_FLAGS_CLASS (g_type_class_ref (type)); + *out = 0; + items = g_strsplit_set (str, "|", 0); for (iter = items; iter && *iter && success; iter++) { if (!*iter[0]) |