aboutsummaryrefslogtreecommitdiff
path: root/src/listalf.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-29 05:18:55 -0500
committerB. Watson <urchlay@slackware.uk>2025-11-29 05:18:55 -0500
commit9cb352eb2dc528043a85cb30b54ba7a0e45c210f (patch)
tree8ca4f14822b727adbea5c793adcecdc636175f81 /src/listalf.c
parentdcf32e932d5b50120d596f4326c40e5316ee2781 (diff)
downloadalftools-9cb352eb2dc528043a85cb30b54ba7a0e45c210f.tar.gz
Show 4-digit year with unalf -v.
Diffstat (limited to 'src/listalf.c')
-rw-r--r--src/listalf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/listalf.c b/src/listalf.c
index fa469d7..34078e5 100644
--- a/src/listalf.c
+++ b/src/listalf.c
@@ -49,7 +49,6 @@ void format_msdos_date(char *buf) {
/* year actually ranges 1980 to 2107... */
year = (d >> 9) + 1980;
- year %= 100; /* ...but only print last 2 digits */
/* valid months range 1 to 12. values 0, 13, 14, 15 are possible
but invalid (print as ???) */
@@ -58,7 +57,7 @@ void format_msdos_date(char *buf) {
/* valid day range is 1 to 31. 0 is invalid, print as-is. */
day = d & 0x1f;
- snprintf(buf, 10, "%2d %3s %02d", day, monthnames[month], year);
+ snprintf(buf, 12, "%2d %3s %04d", day, monthnames[month], year);
}
/* small files may be "compressed" larger than the original, so this
@@ -77,8 +76,8 @@ void list_alf(void) {
extern char *out_filename;
if(opts.verbose_list) {
- puts("Name Length Size now Comp Date Time CkSum");
- puts("============ ======== ======== ==== ========= ========= =====");
+ puts("Name Length Size now Comp Date Time CkSum");
+ puts("============ ======== ======== ==== =========== ========= =====");
}
while(read_alf_header()) {