diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-08-14 19:02:42 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-14 19:02:42 -0300 |
| commit | 9ac5583513070f3f58225250ff2b1edaa080969c (patch) | |
| tree | bb0fd3c5729aacba8540bf70bee773ffdf4e6025 /Ryujinx.HLE/OsHle/Utilities/StringUtils.cs | |
| parent | 17f54b5d78ac9ee83419dc204a02e3887bdca8e4 (diff) | |
Better support for user accounts (#349)
* Better support for user accounts
* Nits
* Check for invalid ids
Diffstat (limited to 'Ryujinx.HLE/OsHle/Utilities/StringUtils.cs')
| -rw-r--r-- | Ryujinx.HLE/OsHle/Utilities/StringUtils.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Ryujinx.HLE/OsHle/Utilities/StringUtils.cs b/Ryujinx.HLE/OsHle/Utilities/StringUtils.cs index b0117f83..90f34695 100644 --- a/Ryujinx.HLE/OsHle/Utilities/StringUtils.cs +++ b/Ryujinx.HLE/OsHle/Utilities/StringUtils.cs @@ -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; |
