Skip to content

Commit

Permalink
bug fix: TryBinaryNumericEncode on small numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
garysharp committed May 4, 2023
1 parent 5a2c29e commit 473b02f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ public static bool TryBinaryNumericEncode(string Data, out byte[] Result)
Result = new byte[4];
int leadingZeros = 0;

for (leadingZeros = 0; leadingZeros <= 4; leadingZeros++)
for (int i = 0; i < Data.Length; i++)
{
if (Data[leadingZeros] != '0')
{
break;
}
leadingZeros++;
}

if (leadingZeros <= 3)
Expand Down

0 comments on commit 473b02f

Please sign in to comment.