BaseTool: Fixed the bug of Boolean Hii Pcd packing.

When packing HiiPcd into PcdNvStoreDefaultValueBuffer,
The boolean type pcd value packing incorrect.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao 2018-08-10 16:12:26 +08:00
parent cb5f4f45ce
commit 669b55e6d5
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ class VariableMgr(object):
Buffer += pack("=B", int(value_char, 16))
data_len += len(tail.split(","))
elif data_type == "BOOLEAN":
Buffer += pack("=B", True) if var_value.upper() == "TRUE" else pack("=B", False)
Buffer += pack("=B", True) if var_value.upper() in ["TRUE","1"] else pack("=B", False)
data_len += 1
elif data_type == DataType.TAB_UINT8:
Buffer += pack("=B", GetIntegerValue(var_value))