This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use right type for offset in sysread() or syswrite()
authorChip Salzenberg <chip@pobox.com>
Wed, 11 Jul 2012 07:05:19 +0000 (00:05 -0700)
committerChip Salzenberg <chip@pobox.com>
Wed, 11 Jul 2012 07:05:19 +0000 (00:05 -0700)
pp_sys.c

index c5d63ac..f0a799e 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1711,7 +1711,7 @@ PP(pp_sysread)
     }
     if (DO_UTF8(bufsv)) {
        /* convert offset-as-chars to offset-as-bytes */
     }
     if (DO_UTF8(bufsv)) {
        /* convert offset-as-chars to offset-as-bytes */
-       if (offset >= (int)blen)
+       if (offset >= (SSize_t)blen)
            offset += SvCUR(bufsv) - blen;
        else
            offset = utf8_hop((U8 *)buffer,offset) - (U8 *) buffer;
            offset += SvCUR(bufsv) - blen;
        else
            offset = utf8_hop((U8 *)buffer,offset) - (U8 *) buffer;