]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-repolist.c
Makefile: install cgit.{css,png} in CGIT_DATA_PATH
[ps-cgit] / ui-repolist.c
index ab050c788af1ca58564f9dd70c7ebc984feadabb..2324273f8df7cc0a81ee787dd707b3047a4a350a 100644 (file)
@@ -6,6 +6,10 @@
  *   (see COPYING for full license text)
  */
 
+/* This is needed for strcasestr to be defined by <string.h> */
+#define _GNU_SOURCE 1
+#include <string.h>
+
 #include <time.h>
 
 #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);