[network-manager-openvpn] properties: fix handling NULL terminated strv array comp_lzo_values



commit a96ba5a40925651c0a53ffeff8e2c1fd4922b4a7
Author: Thomas Haller <thaller redhat com>
Date:   Sat Feb 4 19:25:53 2017 +0100

    properties: fix handling NULL terminated strv array comp_lzo_values
    
    advanced_dialog_new_hash_from_dialog() would use
      G_N_ELEMENTS (comp_lzo_values)
    for the number of values. Since comp_lzo_values is a NULL terminated
    strv array, that was wrong.
    
    Instead, change comp_lzo_values not to be NULL terminated and use
    G_N_ELEMENTS (comp_lzo_values) throughout.
    
    Fixes: f3ec272521ce7788c03c93f8f3baf99d33b167d8

 properties/auth-helpers.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 3cac2ef..132e399 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -44,7 +44,6 @@ static const char *comp_lzo_values[] = {
        "adaptive",
        "yes",
        "no-by-default",
-       NULL,
 };
 
 static const char *
@@ -1792,7 +1791,7 @@ advanced_dialog_new (GHashTable *hash, const char *contype)
        combo = GTK_WIDGET (gtk_builder_get_object (builder, "lzo_combo"));
        store = gtk_list_store_new (1, G_TYPE_STRING);
        active = 0;
-       for (i = 0; comp_lzo_values[i]; i++) {
+       for (i = 0; G_N_ELEMENTS (comp_lzo_values); i++) {
                gtk_list_store_append (store, &iter);
                gtk_list_store_set (store, &iter,
                                    0, comp_lzo_values_conf_to_display (comp_lzo_values[i]),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]