develooper Front page | perl.perl5.porters | Postings from December 2003

[PATCH] win32_chsize buglet

Thread Next
From:
Kevin Chase
Date:
December 29, 2003 02:22
Subject:
[PATCH] win32_chsize buglet
Message ID:
BAY2-F90usv0ccZRh8Z0005683d@hotmail.com
I tried to be adventuresome and build perl-21911 on win32 with a different 
compiler than usual (an old Intel compiler).  All tests passed (hurray), but 
in perusing the warnings I found a bug that should be fixed at some point.  
The problem is count is unsigned, so if (count < 0) is always false.  Here's 
an unglamorous (but correct) fix.

--- win32.c.orig        2003-11-11 13:04:47.000000000 -0800
+++ win32.c     2003-12-28 15:28:46.000000000 -0800
@@ -3130,7 +3130,7 @@
        do {
            count = extend >= sizeof(b) ? sizeof(b) : (size_t)extend;
            count = win32_write(fd, b, count);
-           if (count < 0) {
+           if ((int)count < 0) {
                retval = -1;
                break;
            }

--Kevin

_________________________________________________________________
Get reliable dial-up Internet access now with our limited-time introductory 
offer.  http://join.msn.com/?page=dept/dialup


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About