From DONOTREPLY at icculus.org Wed Jul 11 18:11:29 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 11 Jul 2007 18:11:29 -0400 Subject: r913 - branches/stable-1.0 trunk Message-ID: <20070711221129.20419.qmail@icculus.org> Author: icculus Date: 2007-07-11 18:11:29 -0400 (Wed, 11 Jul 2007) New Revision: 913 Modified: branches/stable-1.0/CHANGELOG branches/stable-1.0/physfs.c trunk/CHANGELOG.txt trunk/physfs.c Log: Fixed crash on zero-byte read/write (thanks, Ensiform!). Modified: branches/stable-1.0/CHANGELOG =================================================================== --- branches/stable-1.0/CHANGELOG 2007-05-27 14:34:29 UTC (rev 912) +++ branches/stable-1.0/CHANGELOG 2007-07-11 22:11:29 UTC (rev 913) @@ -4,6 +4,7 @@ -- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc --- +07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05052007 - Fixed zip archiver: could do bogus seek if a small, non-zip file got put through isArchive(). 04022007 - Fixed Doxygen comment. Modified: branches/stable-1.0/physfs.c =================================================================== --- branches/stable-1.0/physfs.c 2007-05-27 14:34:29 UTC (rev 912) +++ branches/stable-1.0/physfs.c 2007-07-11 22:11:29 UTC (rev 913) @@ -1797,6 +1797,8 @@ FileHandle *h = (FileHandle *) handle->opaque; BAIL_IF_MACRO(!h->forReading, ERR_FILE_ALREADY_OPEN_W, -1); + BAIL_IF_MACRO(objSize == 0, NULL, 0); + BAIL_IF_MACRO(objCount == 0, NULL, 0); if (h->buffer != NULL) return(doBufferedRead(handle, buffer, objSize, objCount)); @@ -1830,6 +1832,8 @@ FileHandle *h = (FileHandle *) handle->opaque; BAIL_IF_MACRO(h->forReading, ERR_FILE_ALREADY_OPEN_R, -1); + BAIL_IF_MACRO(objSize == 0, NULL, 0); + BAIL_IF_MACRO(objCount == 0, NULL, 0); if (h->buffer != NULL) return(doBufferedWrite(handle, buffer, objSize, objCount)); Modified: trunk/CHANGELOG.txt =================================================================== --- trunk/CHANGELOG.txt 2007-05-27 14:34:29 UTC (rev 912) +++ trunk/CHANGELOG.txt 2007-07-11 22:11:29 UTC (rev 913) @@ -2,6 +2,7 @@ * CHANGELOG. */ +07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05272007 - FIXME removal: Replaced a strncpy() with a memcpy(). 05112007 - Minor documentation correction. 05052007 - Fixed zip archiver: could do bogus seek if a small, non-zip file Modified: trunk/physfs.c =================================================================== --- trunk/physfs.c 2007-05-27 14:34:29 UTC (rev 912) +++ trunk/physfs.c 2007-07-11 22:11:29 UTC (rev 913) @@ -1978,6 +1978,8 @@ FileHandle *fh = (FileHandle *) handle; BAIL_IF_MACRO(!fh->forReading, ERR_FILE_ALREADY_OPEN_W, -1); + BAIL_IF_MACRO(objSize == 0, NULL, 0); + BAIL_IF_MACRO(objCount == 0, NULL, 0); if (fh->buffer != NULL) return(doBufferedRead(fh, buffer, objSize, objCount)); @@ -2011,6 +2013,8 @@ FileHandle *fh = (FileHandle *) handle; BAIL_IF_MACRO(fh->forReading, ERR_FILE_ALREADY_OPEN_R, -1); + BAIL_IF_MACRO(objSize == 0, NULL, 0); + BAIL_IF_MACRO(objCount == 0, NULL, 0); if (fh->buffer != NULL) return(doBufferedWrite(handle, buffer, objSize, objCount)); From DONOTREPLY at icculus.org Thu Jul 12 04:58:19 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 12 Jul 2007 04:58:19 -0400 Subject: r914 - branches/stable-1.0 trunk Message-ID: <20070712085819.7017.qmail@icculus.org> Author: icculus Date: 2007-07-12 04:58:09 -0400 (Thu, 12 Jul 2007) New Revision: 914 Modified: branches/stable-1.0/CHANGELOG branches/stable-1.0/physfs_internal.h trunk/CHANGELOG.txt trunk/physfs_internal.h Log: Fixed missing alloc macro on mingw32, I think. Modified: branches/stable-1.0/CHANGELOG =================================================================== --- branches/stable-1.0/CHANGELOG 2007-07-11 22:11:29 UTC (rev 913) +++ branches/stable-1.0/CHANGELOG 2007-07-12 08:58:09 UTC (rev 914) @@ -4,6 +4,7 @@ -- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc --- +07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05052007 - Fixed zip archiver: could do bogus seek if a small, non-zip file got put through isArchive(). Modified: branches/stable-1.0/physfs_internal.h =================================================================== --- branches/stable-1.0/physfs_internal.h 2007-07-11 22:11:29 UTC (rev 913) +++ branches/stable-1.0/physfs_internal.h 2007-07-12 08:58:09 UTC (rev 914) @@ -22,6 +22,10 @@ #define assert(x) #endif +#ifdef __MINGW32__ +#include +#endif + #ifdef __cplusplus extern "C" { #endif Modified: trunk/CHANGELOG.txt =================================================================== --- trunk/CHANGELOG.txt 2007-07-11 22:11:29 UTC (rev 913) +++ trunk/CHANGELOG.txt 2007-07-12 08:58:09 UTC (rev 914) @@ -2,6 +2,7 @@ * CHANGELOG. */ +07122007 - Maybe fixed compile on mingw32. 07112007 - Fixed crash on zero-byte read/write (thanks, Ensiform!). 05272007 - FIXME removal: Replaced a strncpy() with a memcpy(). 05112007 - Minor documentation correction. Modified: trunk/physfs_internal.h =================================================================== --- trunk/physfs_internal.h 2007-07-11 22:11:29 UTC (rev 913) +++ trunk/physfs_internal.h 2007-07-12 08:58:09 UTC (rev 914) @@ -29,6 +29,10 @@ #include #endif +#ifdef __MINGW32__ +#include +#endif + #ifdef __cplusplus extern "C" { #endif From DONOTREPLY at icculus.org Thu Jul 12 06:37:56 2007 From: DONOTREPLY at icculus.org (DONOTREPLY at icculus.org) Date: 12 Jul 2007 06:37:56 -0400 Subject: r915 - branches/stable-1.0 trunk Message-ID: <20070712103756.25504.qmail@icculus.org> Author: icculus Date: 2007-07-12 06:37:56 -0400 (Thu, 12 Jul 2007) New Revision: 915 Modified: branches/stable-1.0/physfs_internal.h trunk/physfs_internal.h Log: Whoops, it's malloc.h, not alloca.h ... Modified: branches/stable-1.0/physfs_internal.h =================================================================== --- branches/stable-1.0/physfs_internal.h 2007-07-12 08:58:09 UTC (rev 914) +++ branches/stable-1.0/physfs_internal.h 2007-07-12 10:37:56 UTC (rev 915) @@ -22,8 +22,8 @@ #define assert(x) #endif -#ifdef __MINGW32__ -#include +#if defined(_MSC_VER) || defined(__MINGW32__) +#include #endif #ifdef __cplusplus Modified: trunk/physfs_internal.h =================================================================== --- trunk/physfs_internal.h 2007-07-12 08:58:09 UTC (rev 914) +++ trunk/physfs_internal.h 2007-07-12 10:37:56 UTC (rev 915) @@ -25,14 +25,10 @@ #endif /* !!! FIXME: remove this when revamping stack allocation code... */ -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #include #endif -#ifdef __MINGW32__ -#include -#endif - #ifdef __cplusplus extern "C" { #endif