diff options
author | pankunull <panku_null@proton.me> | 2025-09-01 06:40:25 +0200 |
---|---|---|
committer | pankunull <panku_null@proton.me> | 2025-09-01 06:40:25 +0200 |
commit | 89bb5b98f50ecdbd75e16449c9ea7dbf4e05aa83 (patch) | |
tree | bddcaa50f6a5bf9f0c2f560b1293dce6cf321dc7 | |
parent | bd2ad840f4f92930710b05a91b32b6038d62ea63 (diff) |
-rw-r--r-- | src/lass.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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); |