strxfrm() returns a size_t, not a ssize_t. See:
Devin Heitmueller [Fri, 20 Apr 2007 18:20:21 +0000 (14:20 -0400)]
Subject: locale.c usage of strxfrm
From: "Devin Heitmueller" <devin.heitmueller@gmail.com>
Message-ID: <412bdbff0704201520i7aac0189n74f0cef5c5213f41@mail.gmail.com>

p4raw-id: //depot/perl@31092

locale.c

index d90b557..c9d0628 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -588,11 +588,11 @@ Perl_mem_collxfrm(pTHX_ const char *s, STRLEN len, STRLEN *xlen)
     *(U32*)xbuf = PL_collation_ix;
     xout = sizeof(PL_collation_ix);
     for (xin = 0; xin < len; ) {
-       SSize_t xused;
+       Size_t xused;
 
        for (;;) {
            xused = strxfrm(xbuf + xout, s + xin, xAlloc - xout);
-           if (xused == -1)
+           if (xused >= PERL_INT_MAX)
                goto bad;
            if ((STRLEN)xused < xAlloc - xout)
                break;