From 1cbb9fa0d938e01a34a0e23b66e1b31e42fb3a11 Mon Sep 17 00:00:00 2001 From: Terence Boldt Date: Sat, 23 Oct 2021 10:06:25 -0400 Subject: [PATCH] Fix DateTimeFromProDOS and tests --- prodos/format_test.go | 2 +- prodos/time.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prodos/format_test.go b/prodos/format_test.go index e8fe22c..dd4f69f 100644 --- a/prodos/format_test.go +++ b/prodos/format_test.go @@ -20,7 +20,7 @@ func TestCreateVolume(t *testing.T) { for _, tt := range tests { testname := fmt.Sprintf("%d", tt.blocks) t.Run(testname, func(t *testing.T) { - fileName := os.TempDir() + "test-volume.hdv" + fileName := os.TempDir() + "/test-volume.hdv" defer os.Remove(fileName) file, err := os.Create(fileName) if err != nil { diff --git a/prodos/time.go b/prodos/time.go index 344b4e2..9803d44 100644 --- a/prodos/time.go +++ b/prodos/time.go @@ -50,7 +50,7 @@ func DateTimeFromProDOS(buffer []byte) time.Time { year = 1900 + int(twoDigitYear) } - month := int(buffer[0]>>5 + buffer[1]&1) + month := int(buffer[0]>>5 + (buffer[1]&1)<<3) day := int(buffer[0] & 31) hour := int(buffer[3]) minute := int(buffer[2])