Better support for user accounts (#349)
* Better support for user accounts * Nits * Check for invalid ids
This commit is contained in:
parent
17f54b5d78
commit
9ac5583513
25 changed files with 314 additions and 136 deletions
|
@ -11,13 +11,13 @@ namespace Ryujinx.HLE.OsHle.Utilities
|
|||
{
|
||||
InputString = InputString + "\0";
|
||||
|
||||
int ByteCount = Encoding.GetByteCount(InputString);
|
||||
int BytesCount = Encoding.GetByteCount(InputString);
|
||||
|
||||
byte[] Output = new byte[Size];
|
||||
|
||||
if (ByteCount < Size)
|
||||
if (BytesCount < Size)
|
||||
{
|
||||
Encoding.GetBytes(InputString, 0, InputString.Length, Output, Size - ByteCount);
|
||||
Encoding.GetBytes(InputString, 0, InputString.Length, Output, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -35,15 +35,14 @@ namespace Ryujinx.HLE.OsHle.Utilities
|
|||
|
||||
public static byte[] HexToBytes(string HexString)
|
||||
{
|
||||
//Ignore last charactor if HexLength % 2 != 0
|
||||
//Ignore last charactor if HexLength % 2 != 0.
|
||||
int BytesInHex = HexString.Length / 2;
|
||||
|
||||
byte[] Output = new byte[BytesInHex];
|
||||
|
||||
for (int Index = 0; Index < BytesInHex; Index++)
|
||||
{
|
||||
Output[Index] = byte.Parse(HexString.Substring(Index * 2, 2),
|
||||
NumberStyles.HexNumber);
|
||||
Output[Index] = byte.Parse(HexString.Substring(Index * 2, 2), NumberStyles.HexNumber);
|
||||
}
|
||||
|
||||
return Output;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue