]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/GenC.py
BaseTools: Similar to octal data rectification
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / GenC.py
index e46942a3e2662be9ebf89b0d485283f9923f0425..f1f3b6f359c55b94b35acafecaa07322a3ce2603 100644 (file)
@@ -1010,7 +1010,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
             try:\r
                 if Value.upper().endswith('L'):\r
                     Value = Value[:-1]\r
-                if Value.startswith('0') and not Value.lower().startswith('0x') and len(Value) > 2:\r
+                if Value.startswith('0') and not Value.lower().startswith('0x') and len(Value) > 1 and Value.lstrip('0'):\r
                     Value = Value.lstrip('0')\r
                 ValueNumber = int (Value, 0)\r
             except:\r