]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-repolist.c
truncate buffer before reading empty files
[ps-cgit] / ui-repolist.c
index 2c13d5041b2a4931358b241b6316db3d96a9a6b5..3aedde5456f761fe58926bfef7e28f389975aa41 100644 (file)
@@ -23,6 +23,7 @@ time_t read_agefile(char *path)
 
        if (!(f = fopen(path, "r")))
                return -1;
+       buf[0] = 0;
        if (fgets(buf, sizeof(buf), f) == NULL)
                return -1;
        fclose(f);