1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-01 13:48:52 +08:00

Merge pull request #924 from nightmared/fix-utf16-windows

fix an invalid shift in windows processes name UTF16 conversion
This commit is contained in:
Lomanic 2020-08-29 18:52:44 +02:00 committed by GitHub
commit d9f9a85e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1002,7 +1002,7 @@ func convertUTF16ToString(src []byte) string {
srcIdx := 0
for i := 0; i < srcLen; i++ {
codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx+1]<<8)
codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx+1])<<8
srcIdx += 2
}
return syscall.UTF16ToString(codePoints)