1.1 --- a/templates/native/iconv.c Mon Feb 13 17:54:29 2017 +0100
1.2 +++ b/templates/native/iconv.c Mon Feb 13 21:26:38 2017 +0100
1.3 @@ -99,9 +99,9 @@
1.4 /* Incomplete sequence: raise the string in an OSError instead. */
1.5
1.6 if (errno == EINVAL)
1.7 - __raise_incomplete_sequence_error(__new_int(errno), __new_str(resultbuf));
1.8 + __raise_incomplete_sequence_error(__new_int(errno), __new_str(resultbuf, outbytestotal));
1.9
1.10 - return __new_str(resultbuf);
1.11 + return __new_str(resultbuf, outbytestotal);
1.12 }
1.13
1.14 /* Invalid sequence. */
1.15 @@ -110,7 +110,7 @@
1.16 {
1.17 resultbuf = __ALLOCATE(inbytesleft + 1, sizeof(char));
1.18 memcpy(resultbuf, inbuf, inbytesleft);
1.19 - __raise_invalid_sequence_error(__new_int(errno), __new_str(resultbuf));
1.20 + __raise_invalid_sequence_error(__new_int(errno), __new_str(resultbuf, inbytesleft));
1.21 }
1.22
1.23 /* General failure. */