From f2a3221f415b970a2a1c03f37b061561d0cc4b28 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 11 Aug 2020 16:40:49 +0200 Subject: fix(treewide): use same type when comparing --- entry.c | 2 +- main.c | 4 ++-- xml.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entry.c b/entry.c index 2dd4650..69a1c57 100644 --- a/entry.c +++ b/entry.c @@ -58,7 +58,7 @@ int make_entry(const char *blog_dir, char *script_name, char *path_info, struct // check if the path_info segments are alright // should be sane coming from a webserver int last_was_slash = 0; - for(int i = 0; i < path_info_len; i++) { + for(size_t i = 0; i < path_info_len; i++) { if(last_was_slash) { switch(path_info[i]) { case '/': diff --git a/main.c b/main.c index 4af412e..b1d74c9 100644 --- a/main.c +++ b/main.c @@ -189,7 +189,7 @@ void blog_index(char script_name[]) { template_header(); - for(size_t i = 0; i < count; i++) { + for(int i = 0; i < count; i++) { if(entry_get_text(&entries[i]) != -1) { template_index_entry(entries[i]); @@ -307,7 +307,7 @@ void blog_rss(char script_name[]) { "type", "application/rss+xml"); } - for(size_t i = 0; i < count; i++) { + for(int i = 0; i < count; i++) { xml_open_tag(&ctx, "item"); xml_open_tag(&ctx, "title"); xml_raw(&ctx, entries[i].title); diff --git a/xml.c b/xml.c index 06ad654..5965a09 100644 --- a/xml.c +++ b/xml.c @@ -90,7 +90,7 @@ void xml_raw(struct xml_context *ctx, const char *str) { void output_attrs(FILE *out, va_list attrs, size_t arg_count) { if(arg_count > 0) { - for(int i = 1; i<=arg_count; i++) { + for(size_t i = 1; i<=arg_count; i++) { if(i % 2) { char *name = va_arg(attrs, char *); if(name == NULL) { -- cgit 1.4.1