]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-repolist.c
ui-repolist.c: do not return random/stale data from read_agefile
[ps-cgit] / ui-repolist.c
index 0a0b6ca19e942f0ddcb52128594f8584aab8c12c..e138f591ae5bc1e6d62ce56d71b24fb745687d3e 100644 (file)
@@ -6,12 +6,6 @@
  *   (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"
 #include "html.h"
 #include "ui-shared.h"
@@ -26,7 +20,7 @@ time_t read_agefile(char *path)
        if (readfile(path, &buf, &size))
                return -1;
 
-       if (parse_date(buf, buf2, sizeof(buf2)))
+       if (parse_date(buf, buf2, sizeof(buf2)) > 0)
                result = strtoul(buf2, NULL, 10);
        else
                result = 0;