mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
utilities.py: Ensure null terminators are stripped when value is already string
This commit is contained in:
@@ -345,8 +345,11 @@ def get_nvram(variable: str, uuid: str = None, *, decode: bool = False):
|
|||||||
|
|
||||||
value = ioreg.corefoundation_to_native(value)
|
value = ioreg.corefoundation_to_native(value)
|
||||||
|
|
||||||
if decode and isinstance(value, bytes):
|
if decode:
|
||||||
value = value.strip(b"\0").decode()
|
if isinstance(value, bytes):
|
||||||
|
value = value.strip(b"\0").decode()
|
||||||
|
elif isinstance(value, str):
|
||||||
|
value = value.strip("\0")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user