From 5a9e890f57c51b1cd5ce58b8cad1ff1cb9808a77 Mon Sep 17 00:00:00 2001 From: 8nl <8nl@noreply.git.macaw.me> Date: Sun, 10 Nov 2024 09:57:10 +0000 Subject: [PATCH] Upload files to "/" --- img.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img.c b/img.c index b09f609..58dc405 100644 --- a/img.c +++ b/img.c @@ -242,9 +242,9 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, fprintf(fp, "\n\n\n%s\n\n", CSS, TITLE); /* Tags */ - fputs("\n

\nall ", fp); + fputs("\n

\n [all] ", fp); for (size_t i = 0; i < ut.size; i++) - fprintf(fp, "%s ", ut.tags[i], ut.tags[i]); + fprintf(fp, " [%s] ", ut.tags[i], ut.tags[i]); fputs("


\n
\n", fp); /* Images */ @@ -276,7 +276,7 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, break; } - for (size_t i = 0; i < pages; i++) { + for (size_t i = 0; i <= pages; i++) { if (i == 0) { if (i == page) fprintf(fp, "(0) ", file); @@ -314,6 +314,11 @@ void build(const char *file, const struct UNIQ_TAGS ut, struct DB_STR *db) { while (p != NULL) { struct DB_STR *i = p->next; + if (count == POST_PER_PAGE) { + count = 0; + pages++; + } + if (!strcmp(file, "index")) count++; @@ -323,11 +328,6 @@ void build(const char *file, const struct UNIQ_TAGS ut, struct DB_STR *db) { count++; } - if (count >= POST_PER_PAGE) { - count = 0; - pages++; - } - p = i; }