# define iconv_open(tocode, fromcode) ((iconv_t) -1)
# undef iconv
-# define iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) (errno = ENOSYS, (size_t) -1)
+# define iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) \
+ (errno = ENOSYS, SIZE_MAX)
# undef iconv_close
# define iconv_close(cd) 0
*output = xstrdup (input);
return true;
}
- else if (cd == (iconv_t)-1)
+ else if (cd == (iconv_t) -1)
return false;
inlen = strlen (input) + 1;
implementation-defined conversion on this character." It will "update
the variables pointed to by the arguments to reflect the extent of the
conversion and return the number of non-identical conversions performed".
- On error, it returns -1.
+ On error, it returns SIZE_MAX.
In other words, non-zero return always indicates failure, either because
the input was not fully converted, or because it was converted in a
non-reversible way.