From d2085ad7f2db7310f99726c5c3b1c9019f3947cc Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 2 Dec 2025 21:22:32 -0500 Subject: unalf: warn about all-zero ALF header dates. --- src/alf.1 | 5 +++-- src/alf.rst | 3 ++- src/crunch.c | 1 + src/extract.c | 5 ++++- src/unalf.1 | 8 +++++++- src/unalf.rst | 6 ++++++ 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/alf.1 b/src/alf.1 index d645742..371f903 100644 --- a/src/alf.1 +++ b/src/alf.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "ALF" 1 "2025-12-01" "0.3.0" "Urchlay's Atari 8-bit Tools" +.TH "ALF" 1 "2025-12-02" "0.3.0" "Urchlay's Atari 8-bit Tools" .SH NAME alf \- create Atari 8-bit ALF archives .\" RST source for alf(1) man page. Convert with: @@ -108,7 +108,8 @@ Use UTC for timestamps (default is local timezone). .INDENT 0.0 .TP .B \fB\-tz\fP -Use zero for timestamps (0 ??? 80 12:00a). +Use zero for timestamps. \fBunalf\fP will display \fI\fP for the +date and midnight for the time. .UNINDENT .\" use zero timestamps. . diff --git a/src/alf.rst b/src/alf.rst index 75869ca..267f993 100644 --- a/src/alf.rst +++ b/src/alf.rst @@ -84,7 +84,8 @@ OPTIONS .. use UTC timestamps. **-tz** - Use zero for timestamps (0 ??? 80 12:00a). + Use zero for timestamps. **unalf** will display ** for the + date and midnight for the time. .. use zero timestamps. diff --git a/src/crunch.c b/src/crunch.c index ada46e8..5f21223 100644 --- a/src/crunch.c +++ b/src/crunch.c @@ -121,6 +121,7 @@ void inc_output_len(void) { fprintf(stderr, "%s: fatal: compressed file would be >16MB.\n", self); exit(1); } + output_buf[output_len] = 0; } void append_bit(int bit) { diff --git a/src/extract.c b/src/extract.c index b14b321..98523db 100644 --- a/src/extract.c +++ b/src/extract.c @@ -51,7 +51,10 @@ void set_datetime() { t = dpeek(alf_hdr_time0); /* don't set the date/time at all, if it's zero */ - if(!t) return; + if(!t) { + fprintf(stderr, "%s: warning: date/time for %s is null, using current date/time\n", self, out_filename); + return; + } d = dpeek(alf_hdr_date0); diff --git a/src/unalf.1 b/src/unalf.1 index c1683a4..f7d4ff3 100644 --- a/src/unalf.1 +++ b/src/unalf.1 @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "UNALF" 1 "2025-12-01" "0.3.0" "Urchlay's Atari 8-bit Tools" +.TH "UNALF" 1 "2025-12-02" "0.3.0" "Urchlay's Atari 8-bit Tools" .SH NAME unalf \- extract Atari 8-bit ALF archives .\" RST source for unalf(1) man page. Convert with: @@ -345,6 +345,12 @@ your \fIALF\fP file actually contains another \fIALF\fP file, but that would be a pathological case. Most likely, you\(aqre trying to extract multiple \fIALF\fP files with one command, which doesn\(aqt work. Use one \fBunalf\fP command per file. +.TP +.B \fBdate/time for is null, using current date/time\fP +The date stored in the \fIALF\fP header for this file is all zeroes, which +is an invalid date. \fBunalf \-v\fP shows this as \fI\fP\&. The +date on the extracted file can\(aqt be set, so it\(aqll have the current +date and time instead. .UNINDENT .SH NOTES .sp diff --git a/src/unalf.rst b/src/unalf.rst index 3550a3b..146e056 100644 --- a/src/unalf.rst +++ b/src/unalf.rst @@ -300,6 +300,12 @@ Warnings *ALF* files with one command, which doesn't work. Use one **unalf** command per file. +**date/time for is null, using current date/time** + The date stored in the *ALF* header for this file is all zeroes, which + is an invalid date. **unalf -v** shows this as **. The + date on the extracted file can't be set, so it'll have the current + date and time instead. + NOTES ===== -- cgit v1.2.3