From 4916ba77785633cd0d74a05802d0fc08764f40dc Mon Sep 17 00:00:00 2001 From: sijanec Date: Sun, 4 Apr 2021 22:52:39 +0200 Subject: number of results=100, css fixes, breadcrumbs, removed googleweblight, desc on top fix --- src/httpd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/httpd.c') diff --git a/src/httpd.c b/src/httpd.c index bf5c3d1..656ad92 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -9,13 +9,17 @@ char * sc_queryhtml (struct sc_query * q) { /* remember to free returned string string##_sizeof = (string##_written+wanted+1)*SC_REALLOC_K; \ string = realloc(string, string##_sizeof); \ } -#define SC_HRF "

%s

%s

" +#define SC_HRF "

%s " \ + "%s

%s

" +#define SC_HRA i, safeurl, i, safetitle, safebreadcrumbs, safebody char * safetitle = htmlspecialchars(q->results[i]->title); char * safebody = htmlspecialchars(q->results[i]->desc); char * safeurl = htmlspecialchars(q->results[i]->url); - size_t ws = snprintf(NULL, 0, SC_HRF, safeurl, safetitle, safebody); + char * safebreadcrumbs = htmlspecialchars(q->results[i]->breadcrumbs); + size_t ws = snprintf(NULL, 0, SC_HRF, SC_HRA); SC_HRC(resultshtml, ws); - resultshtml_written += sprintf(resultshtml+resultshtml_written, SC_HRF, safeurl, safetitle, safebody); + resultshtml_written += sprintf(resultshtml+resultshtml_written, SC_HRF, SC_HRA); + free(safebreadcrumbs); free(safetitle); free(safebody); free(safeurl); -- cgit v1.2.3