Skip to content

Commit e9c0cbe

Browse files
author
Matthew Wong
committed
Check identifier page CodeSet
1 parent c277b04 commit e9c0cbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/os/disk/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (DiskAPI) GetDiskPage83ID(disk syscall.Handle) (string, error) {
220220
page83ID := []byte{}
221221
byteSize := unsafe.Sizeof(byte(0))
222222
for n = 0; n < devIDDesc.NumberOfIdentifiers; n++ {
223-
if pID.Association == StorageIDAssocDevice {
223+
if pID.Association == StorageIDAssocDevice && (pID.CodeSet == StorageIDCodeSetBinary || pID.CodeSet == StorageIDCodeSetASCII) {
224224
for m = 0; m < pID.IdentifierSize; m++ {
225225
page83ID = append(page83ID, *(*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&pID.Identifier[0])) + byteSize*uintptr(m))))
226226
}

0 commit comments

Comments
 (0)