diff options
| -rw-r--r-- | src/content-parser.c | 2 | ||||
| -rw-r--r-- | tests/check_content_parser.c | 8 | 
2 files changed, 6 insertions, 4 deletions
| diff --git a/src/content-parser.c b/src/content-parser.c index 1529ace..f451587 100644 --- a/src/content-parser.c +++ b/src/content-parser.c @@ -1109,7 +1109,7 @@ param_end:                  if (c == '\n' || c == '\r' || is_last) {                      char *rv_d = blogc_directive_loader(directive_name,                          directive_argument, directive_params); -                    if (rv_d) +                    if (rv_d != NULL)                          b_string_append(rv, rv_d);                      free(rv_d);                      state = CONTENT_START_LINE; diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index 5d13564..8bd16ec 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1026,9 +1026,11 @@ __wrap_blogc_directive_loader(const char *name, const char *argument,          assert_string_equal(argument, arg);      assert_int_equal(b_trie_size(params), mock_type(unsigned int)); -    for (unsigned int i = 0; i < b_trie_size(params); i++) -        assert_string_equal(b_trie_lookup(params, mock_type(const char*)), -            mock_type(const char*)); +    for (unsigned int i = 0; i < b_trie_size(params); i++) { +        const char *key = mock_type(const char*); +        const char *value = mock_type(const char*); +        assert_string_equal(b_trie_lookup(params, key), value); +    }      return b_strdup("CHUNDA\n");  } | 
