diff options
-rw-r--r-- | hittpd.c | 7 |
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++) |