Added check for results in example selectors_low_level https://github.com/lexborisov/Modest/issues/5

This commit is contained in:
lexborisov 2016-11-21 19:55:45 +03:00
parent 4b2dfdb4c8
commit cad3ee5404

View File

@ -93,12 +93,19 @@ int main(int argc, const char * argv[])
mycss_selectors_serialization_list(mycss_entry_selectors(css_entry), list, serialization_callback, NULL);
fprintf(stdout, "\n");
printf("\nFound result:\n");
for(size_t i = 0; i < collection->length; i++) {
fprintf(stdout, "\t");
myhtml_tree_print_node(html_tree, collection->list[i], stdout);
if(collection) {
printf("\nFound result:\n");
for(size_t i = 0; i < collection->length; i++) {
fprintf(stdout, "\t");
myhtml_tree_print_node(html_tree, collection->list[i], stdout);
}
fprintf(stdout, "\n");
}
else {
printf("\nFound result: empty\n");
}
fprintf(stdout, "\n");
// destroy all
mycss_selectors_list_destroy(mycss_entry_selectors(css_entry), list, true);