summaryrefslogtreecommitdiff
path: root/src/lass.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lass.c')
-rw-r--r--src/lass.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lass.c b/src/lass.c
index ddbced0..75c61c5 100644
--- a/src/lass.c
+++ b/src/lass.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * lass.c - list files and directories in kernel style
+ * lass.c - list files and directories in Kebab style
*/
#include <stdio.h>
@@ -29,8 +29,7 @@ static void print_file_info(const char *path, const char *name, int width_uid,
struct passwd *pw;
struct group *gr;
struct tm *timeinfo;
- time_t rawtime;
- char time_buffer[20];
+ char time_buffer[64];
if (stat(path, &st))
return;
@@ -59,11 +58,9 @@ static void print_file_info(const char *path, const char *name, int width_uid,
printf(" %*s %*s ", width_uid, pw ? pw->pw_name : "?",
width_gid, gr ? gr->gr_name : "?");
- time(&rawtime);
- timeinfo = localtime(&rawtime);
-
+ timeinfo = localtime(&st.st_mtime);
strftime(time_buffer, sizeof(time_buffer),
- "%a %b %d %H:%M:%S %Y", timeinfo);
+ "%a %b %d %H:%M:%S %Y", timeinfo);
printf("%s ", time_buffer);