We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b06c0e commit c61b745Copy full SHA for c61b745
1 file changed
OpenHardwareMonitorLib/Hardware/Battery/BatteryGroup.cs
@@ -33,7 +33,7 @@ static bool QueryStringFromBatteryInfo(SafeFileHandle battery, Kernel32.BATTERY_
33
// terminator char.
34
// See https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/1158#issuecomment-1979559929
35
int stringSizeChars = (int)stringSizeBytes / 2;
36
- value = Marshal.PtrToStringUni(ptrString, stringSizeChars);
+ value = Marshal.PtrToStringUni(ptrString, stringSizeChars).Trim('\0');
37
result = true;
38
}
39
0 commit comments