Browse Source

2002-05-19 Martin Baulig <[email protected]>

	* 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
Martin Baulig 24 years ago
parent
commit
915c658177
2 changed files with 6 additions and 1 deletions
  1. 5 0
      mono/metadata/ChangeLog
  2. 1 1
      mono/metadata/unicode.c

+ 5 - 0
mono/metadata/ChangeLog

@@ -1,3 +1,8 @@
+2002-05-19  Martin Baulig  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* assembly.c (mono_assembly_setrootdir): New function used to

+ 1 - 1
mono/metadata/unicode.c

@@ -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);