Fix DateTimeFromProDOS and tests

This commit is contained in:
Terence Boldt 2021-10-23 10:06:25 -04:00
parent c17bfa0b4d
commit 1cbb9fa0d9
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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])