From fab7a00da328debef4fbeba9eb21fc02cf21675d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 19 Aug 2023 13:26:46 +0200 Subject: Update html-parser version to latest, add html_node_find_child --- tests/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/main.c') diff --git a/tests/main.c b/tests/main.c index 4c9e93c..7ba19f5 100644 --- a/tests/main.c +++ b/tests/main.c @@ -4,6 +4,7 @@ #include char* file_get_content(const char *path, long *filesize) { + char *data; FILE *file = fopen(path, "rb"); if(!file) { perror(path); @@ -14,7 +15,7 @@ char* file_get_content(const char *path, long *filesize) { *filesize = ftell(file); fseek(file, 0, SEEK_SET); - char *data = malloc(*filesize); + data = malloc(*filesize); fread(data, 1, *filesize, file); fclose(file); return data; @@ -56,7 +57,7 @@ void html_node_print(HtmlNode *node) { } } -int main() { +int main(void) { int result; HtmlTree html_tree; long filesize; -- cgit v1.2.3