X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/49ecbbddf0659c6409befcfe8989f92196133cda..d529c6fbdca7ce3782e75b3a74baad21ef2f92c3:/ui-repolist.c diff --git a/ui-repolist.c b/ui-repolist.c index ab050c7..2324273 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -6,6 +6,10 @@ * (see COPYING for full license text) */ +/* This is needed for strcasestr to be defined by */ +#define _GNU_SOURCE 1 +#include + #include #include "cgit.h" @@ -19,7 +23,8 @@ time_t read_agefile(char *path) if (!(f = fopen(path, "r"))) return -1; - fgets(buf, sizeof(buf), f); + if (fgets(buf, sizeof(buf), f) == NULL) + return -1; fclose(f); if (parse_date(buf, buf2, sizeof(buf2))) return strtoul(buf2, NULL, 10);