Skip to content

Commit c61b745

Browse files
committed
battery name retrieving fix
1 parent 5b06c0e commit c61b745

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OpenHardwareMonitorLib/Hardware/Battery/BatteryGroup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static bool QueryStringFromBatteryInfo(SafeFileHandle battery, Kernel32.BATTERY_
3333
// terminator char.
3434
// See https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/1158#issuecomment-1979559929
3535
int stringSizeChars = (int)stringSizeBytes / 2;
36-
value = Marshal.PtrToStringUni(ptrString, stringSizeChars);
36+
value = Marshal.PtrToStringUni(ptrString, stringSizeChars).Trim('\0');
3737
result = true;
3838
}
3939

0 commit comments

Comments
 (0)