[json-glib] parser: Correctly increment the array index counter



commit c34b3541f9d2cb388bc20fecc9cf412d6ab0716d
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Feb 25 09:41:38 2016 +0000

    parser: Correctly increment the array index counter
    
    We pass the counter to the JsonParser::array-element signal, but we
    never really increment it.

 json-glib/json-parser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/json-glib/json-parser.c b/json-glib/json-parser.c
index c46de5b..ee4e765 100644
--- a/json-glib/json-parser.c
+++ b/json-glib/json-parser.c
@@ -507,7 +507,7 @@ json_parse_array (JsonParser   *parser,
             }
         }
 
-      JSON_NOTE (PARSER, "Array element %d completed", idx + 1);
+      JSON_NOTE (PARSER, "Array element %d completed", idx);
       json_node_set_parent (element, priv->current_node);
       json_array_add_element (array, element);
 
@@ -515,6 +515,7 @@ json_parse_array (JsonParser   *parser,
                      array,
                      idx);
 
+      idx += 1;
       token = next_token;
     }
 


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