aboutsummaryrefslogtreecommitdiffstats
path: root/ext/iconv/iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/iconv/iconv.c')
-rw-r--r--ext/iconv/iconv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index c4c6fd8124..cf77ee3e2c 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -464,7 +464,11 @@ iconv_convert(iconv_t cd, VALUE str, long start, long length, int toidx, struct
errmsg[0] = 0;
error = iconv_try(cd, &inptr, &inlen, &outptr, &outlen);
- if (0 <= outlen && outlen <= sizeof(buffer)) {
+ if (
+#if SIGNEDNESS_OF_SIZE_T < 0
+ 0 <= outlen &&
+#endif
+ outlen <= sizeof(buffer)) {
outlen = sizeof(buffer) - outlen;
if (NIL_P(error) || /* something converted */
outlen > (size_t)(inptr - tmpstart) || /* input can't contain output */