mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Preinitialize length for SpacePaddedToString().
This commit is contained in:
@@ -89,7 +89,7 @@ namespace DiscImageChef
|
||||
/// <param name="SpacePaddedString">A space (' ', 0x20, ASCII SPACE) padded ASCII byte array</param>
|
||||
public static string SpacePaddedToString(byte[] SpacePaddedString)
|
||||
{
|
||||
int length;
|
||||
int length = 0;
|
||||
|
||||
for (int i = SpacePaddedString.Length; i >= 0; i--)
|
||||
{
|
||||
@@ -103,6 +103,9 @@ namespace DiscImageChef
|
||||
}
|
||||
}
|
||||
|
||||
if (length == 0)
|
||||
return "";
|
||||
|
||||
return Encoding.ASCII.GetString(SpacePaddedString, 0, length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user