summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-08-10 22:56:14 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-08-10 22:56:14 +0200
commit9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa (patch)
tree0c769099dec285b2a9ac3574a4fd09b5f8ea6e08
parent69a1701438fa91a23b452255e870542dfd250255 (diff)
downloadhittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.tar.gz
hittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.tar.xz
hittpd-9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa.zip
accesslog: clean up, rename buf to logtimestamp
-rw-r--r--hittpd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hittpd.c b/hittpd.c
index 77fcda3..c08b129 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -257,14 +257,15 @@ accesslog(http_parser *p, int status)
 
 	struct conn_data *data = p->data;
 
-	char buf[64];
-	strftime(buf, 64, "[%d/%b/%Y:%H:%M:%S %z]", localtime(&now));
+	char logtimestamp[64];
+	strftime(logtimestamp, sizeof logtimestamp,
+	    "[%d/%b/%Y:%H:%M:%S %z]", localtime(&now));
 
 //	REMOTEHOST - - [DD/MON/YYYY:HH:MM:SS -TZ] "METHOD PATH" STATUS BYTES
 // ?    REFERER USER_AGENT
 	printf("%s - - %s \"%s ",
 	    peername(data->fd),
-	    buf,
+	    logtimestamp,
 	    http_method_str(p->method));
 
 	for (char *s = data->path; *s; s++)