From 9ac5583513070f3f58225250ff2b1edaa080969c Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 14 Aug 2018 19:02:42 -0300 Subject: Better support for user accounts (#349) * Better support for user accounts * Nits * Check for invalid ids --- Ryujinx.HLE/OsHle/Utilities/StringUtils.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Ryujinx.HLE/OsHle/Utilities/StringUtils.cs') 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; -- cgit v1.2.3