[libgdata] documents: Assert that parsing a known JSON string member succeeds



commit e98aabd114aa5d86d41b0da50c720fda58cd3b1e
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun May 3 12:09:22 2015 +0100

    documents: Assert that parsing a known JSON string member succeeds
    
    gdata_parser_string_from_json_member() should return TRUE iff it matched
    the given member (even if parsing fails). Since the member name comes
    from a loop over the existing members, this should always succeed.
    
    Spotted by Coverity.
    
    CID: #109873

 .../services/documents/gdata-documents-document.c  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-document.c 
b/gdata/services/documents/gdata-documents-document.c
index 625a7e8..46d0a29 100644
--- a/gdata/services/documents/gdata-documents-document.c
+++ b/gdata/services/documents/gdata-documents-document.c
@@ -295,7 +295,7 @@ parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GEr
 
                        format = json_reader_get_member_name (reader);
 
-                       gdata_parser_string_from_json_member (reader, format, P_REQUIRED | P_NON_EMPTY, &uri, 
&success, NULL);
+                       g_assert (gdata_parser_string_from_json_member (reader, format, P_REQUIRED | 
P_NON_EMPTY, &uri, &success, NULL));
                        if (success) {
                                g_hash_table_insert (priv->export_links, g_strdup (format), uri);
                                uri = NULL;


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