1.1 --- a/templates/native/iconv.c Sat Feb 11 15:34:30 2017 +0100
1.2 +++ b/templates/native/iconv.c Sat Feb 11 16:04:40 2017 +0100
1.3 @@ -1,6 +1,6 @@
1.4 /* Native functions for character set conversion.
1.5
1.6 -Copyright (C) 2016 Paul Boddie <paul@boddie.org.uk>
1.7 +Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.8
1.9 This program is free software; you can redistribute it and/or modify it under
1.10 the terms of the GNU General Public License as published by the Free Software
1.11 @@ -99,9 +99,9 @@
1.12 /* Incomplete sequence: raise the string in an OSError instead. */
1.13
1.14 if (errno == EINVAL)
1.15 - __raise_incomplete_sequence_error(__new_int(errno), __new_str(resultbuf, outbytestotal));
1.16 + __raise_incomplete_sequence_error(__new_int(errno), __new_str(resultbuf));
1.17
1.18 - return __new_str(resultbuf, outbytestotal);
1.19 + return __new_str(resultbuf);
1.20 }
1.21
1.22 /* Invalid sequence. */
1.23 @@ -110,7 +110,7 @@
1.24 {
1.25 resultbuf = __ALLOCATE(inbytesleft + 1, sizeof(char));
1.26 memcpy(resultbuf, inbuf, inbytesleft);
1.27 - __raise_invalid_sequence_error(__new_int(errno), __new_str(resultbuf, inbytesleft));
1.28 + __raise_invalid_sequence_error(__new_int(errno), __new_str(resultbuf));
1.29 }
1.30
1.31 /* General failure. */