Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System.Text/Decoder.cs')
-rw-r--r--mcs/class/corlib/System.Text/Decoder.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/mcs/class/corlib/System.Text/Decoder.cs b/mcs/class/corlib/System.Text/Decoder.cs
index fe715c33796..cf2e6f23efc 100644
--- a/mcs/class/corlib/System.Text/Decoder.cs
+++ b/mcs/class/corlib/System.Text/Decoder.cs
@@ -149,7 +149,10 @@ public abstract class Decoder
out int bytesUsed, out int charsUsed, out bool completed)
{
CheckArguments (bytes, byteIndex, byteCount);
- CheckArguments (chars, charIndex);
+ if (chars == null)
+ throw new ArgumentNullException ("chars");
+ if (charIndex < 0)
+ throw new ArgumentOutOfRangeException ("charIndex");
if (charCount < 0 || chars.Length < charIndex + charCount)
throw new ArgumentOutOfRangeException ("charCount");
@@ -169,7 +172,7 @@ public abstract class Decoder
{
if (chars == null)
throw new ArgumentNullException ("chars");
- if (charIndex < 0 || chars.Length <= charIndex)
+ if (charIndex < 0 || chars.Length < charIndex)
throw new ArgumentOutOfRangeException ("charIndex");
}
@@ -177,7 +180,7 @@ public abstract class Decoder
{
if (bytes == null)
throw new ArgumentNullException ("bytes");
- if (byteIndex < 0 || bytes.Length <= byteIndex)
+ if (byteIndex < 0)
throw new ArgumentOutOfRangeException ("byteIndex");
if (byteCount < 0 || bytes.Length < byteIndex + byteCount)
throw new ArgumentOutOfRangeException ("byteCount");