commit 21ec61991f3b73028ef4a102254d737684627a6b
parent a1fa707eec08a573392d6921a527b52b4e2c53d0
Author: sin <sin@2f30.org>
Date: Wed, 13 Aug 2014 23:19:49 +0100
Ensure mod is properly initialized
Fixes a segfault.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/quark.c b/quark.c
@@ -211,8 +211,9 @@ responsefile(void) {
if (req.type == GET)
writetext("\r\n<html><body>"HttpNotFound"</body></html>\r\n");
} 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;