From e19bb2ea3ece45dc6c9a6d8d71f4083e9063b5fc Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Tue, 10 Aug 2021 22:57:04 +0200 Subject: clean up, don't shadow timestamp --- hittpd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hittpd.c b/hittpd.c index c08b129..fef83d8 100644 --- a/hittpd.c +++ b/hittpd.c @@ -685,14 +685,14 @@ on_message_complete(http_parser *p) { int len = strlen(file) + !!S_ISDIR(ist.st_mode); fprintf(stream, "%-*.*s ", 48 - len, 48 - len, ""); - char timestamp[64]; - strftime(timestamp, sizeof timestamp, + char filetimestamp[64]; + strftime(filetimestamp, sizeof filetimestamp, "%Y-%m-%d %H:%M", localtime(&ist.st_mtime)); if (S_ISDIR(ist.st_mode)) - fprintf(stream, " %s %12s\n", timestamp, "-"); + fprintf(stream, " %s %12s\n", filetimestamp, "-"); else - fprintf(stream, " %s %12jd\n", timestamp, + fprintf(stream, " %s %12jd\n", filetimestamp, (intmax_t)ist.st_size); } -- cgit 1.4.1