Do not attempt to write 0 bytes.
[mono.git] / mcs / class / System / System.Net / ChunkStream.cs
index 2c29b417c9cfb6bd1f3739016131a3b6e5221093..b3888fb1581c24f417e505c54c4423411b41c185 100644 (file)
@@ -130,7 +130,8 @@ namespace System.Net
                
                public void Write (byte [] buffer, int offset, int size)
                {
-                       InternalWrite (buffer, ref offset, size);
+                       if (offset < size)
+                               InternalWrite (buffer, ref offset, size);
                }
                
                void InternalWrite (byte [] buffer, ref int offset, int size)