commit 21ec61991f3b73028ef4a102254d737684627a6b
Author: sin <[email protected]>
Date:   Wed Aug 13 23:19:49 2014 +0100

    Ensure mod is properly initialized
    
    Fixes a segfault.

diff --git a/quark.c b/quark.c
index 43e976b..f5a74a3 100644
--- a/quark.c
+++ b/quark.c
@@ -211,8 +211,9 @@ responsefile(void) {
                if (req.type == GET)
                        writetext("
<html><body>"HttpNotFound"</body></html>
");
        } else {
+               snprintf(mod, sizeof(mod), "%s", tstamp(st.st_mtim.tv_sec));
                /* check if modified */
-               if (!strcmp(reqmod, tstamp(st.st_mtim.tv_sec))
+               if (!strcmp(reqmod, mod)
                 && !putresentry(HEADER, HttpNotModified, tstamp(0))) {
                        /* not modified, we're done here*/
                        status = 304;


Reply via email to