mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-11 12:54:15 +02:00
Stricter parsing
This commit is contained in:
parent
2fbaf061ef
commit
cc47080e96
1 changed files with 4 additions and 0 deletions
|
@ -154,11 +154,15 @@ namespace System
|
||||||
}
|
}
|
||||||
else if ((c >= 'a') && (c <= 'f'))
|
else if ((c >= 'a') && (c <= 'f'))
|
||||||
{
|
{
|
||||||
|
if (radix != 0x10)
|
||||||
|
return .Err(.InvalidChar(result));
|
||||||
result *= radix;
|
result *= radix;
|
||||||
result += c - 'a' + 10;
|
result += c - 'a' + 10;
|
||||||
}
|
}
|
||||||
else if ((c >= 'A') && (c <= 'F'))
|
else if ((c >= 'A') && (c <= 'F'))
|
||||||
{
|
{
|
||||||
|
if (radix != 0x10)
|
||||||
|
return .Err(.InvalidChar(result));
|
||||||
result *= radix;
|
result *= radix;
|
||||||
result += c - 'A' + 10;
|
result += c - 'A' + 10;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue