else
return UNZ_EOF;
}
- }
- */
+ }
+ */
/* ===========================================================================
- Reads a long in LSB order from the given gz_stream. Sets
- */
- static int unzlocal_getShort( FILE* fin, uLong *pX ){
- short v;
+ Reads a long in LSB order from the given gz_stream. Sets
+ */
+ static int unzlocal_getShort (FILE* fin, uLong *pX)
+ {
+ short v;
- fread( &v, sizeof(v), 1, fin );
+ if ( fread( &v, sizeof( v ), 1, fin ) != 1 ) {
+ return UNZ_EOF;
+ }
- *pX = __LittleShort( v );
+ *pX = __LittleShort( v);
return UNZ_OK;
/*
if (err==UNZ_OK)
err = unzlocal_getByte(fin,&i);
x += ((uLong)i)<<8;
-
+
if (err==UNZ_OK)
- *pX = x;
+ *pX = x;
else
- *pX = 0;
+ *pX = 0;
return err;
- */
+ */
}
- static int unzlocal_getLong( FILE *fin, uLong *pX ){
- int v;
+ static int unzlocal_getLong (FILE *fin, uLong *pX)
+ {
+ int v;
- fread( &v, sizeof(v), 1, fin );
+ if ( fread( &v, sizeof( v ), 1, fin ) != 1 ) {
+ return UNZ_EOF;
+ }
- *pX = __LittleLong( v );
+ *pX = __LittleLong( v);
return UNZ_OK;
/*
typedef struct pngBuffer_s
{
byte *buffer;
- int size, offset;
+ png_size_t size, offset;
- }
- pngBuffer_t;
+ } pngBuffer_t;
void PNGReadData( png_struct *png, png_byte *buffer, png_size_t size ){
pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png );