From a19e3705a228735eacadd713b28d49fe33bb726b Mon Sep 17 00:00:00 2001 From: sijanec Date: Wed, 7 Apr 2021 23:15:16 +0200 Subject: UTF-8, image support, memory leaks fixed --- src/lib.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib.c') diff --git a/src/lib.c b/src/lib.c index 5c0576e..8659431 100644 --- a/src/lib.c +++ b/src/lib.c @@ -84,6 +84,7 @@ void printNode (xmlNodePtr node, void * data) { #define gnu_code_start \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wpedantic\"") + _Pragma ("GCC diagnostic ignored \"-Wformat=\"") #define gnu_code_end \ _Pragma ("GCC diagnostic pop") /* this is the definition of the anonymous function - source: https://en.wikipedia.org/wiki/Anonymous_function#GCC */ @@ -94,6 +95,8 @@ void printNode (xmlNodePtr node, void * data) { &l_anonymous_functions_name; \ }) char * htmlspecialchars (const char * i) { /* remember to free the output */ + if (!i) + return NULL; size_t s = 128; char * o = malloc(s); size_t w = 0; -- cgit v1.2.3