2002-05-19 Martin Baulig <martin@gnome.org>
authorMartin Baulig <martin@novell.com>
Sat, 18 May 2002 20:27:08 +0000 (20:27 -0000)
committerMartin Baulig <martin@novell.com>
Sat, 18 May 2002 20:27:08 +0000 (20:27 -0000)
* unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
argument to get the length, don't default to the array length.

svn path=/trunk/mono/; revision=4751

mono/metadata/ChangeLog
mono/metadata/unicode.c

index ad8204a5fc813978e6c9cf0c3c577d20cb4f3e05..5ea0de42ef2a43181ff2af2a02edf2c2731f9898 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-19  Martin Baulig  <martin@gnome.org>
+
+       * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
+       argument to get the length, don't default to the array length.
+
 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
 
        * assembly.c (mono_assembly_setrootdir): New function used to
index b04230c2d48ef212ce226deaec2fd7931661dada..05a24c89905de498ee4d5a8633e0064c13541f12 100644 (file)
@@ -414,7 +414,7 @@ ves_icall_iconv_get_bytes (gpointer converter, MonoArray *chars, gint32 charInde
        g_assert (mono_array_length (bytes) > byteIndex);
        g_assert (mono_array_length (chars) >= (byteIndex + charCount));
 
-       if (!(len = (mono_array_length (chars) - charIndex) * 2))
+       if (!(len = (charCount - charIndex) * 2))
                return 0;
 
        src =  mono_array_addr (chars, guint16, charIndex);