From 9bc97215c6df6c90cea1ff3a7e8fa42731c4bdfa Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 10 Aug 2021 22:56:14 +0200 Subject: accesslog: clean up, rename buf to logtimestamp --- hittpd.c | 7 ++++--- 1 file 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++) -- cgit 1.4.1