return error
This commit is contained in:
@@ -523,12 +523,11 @@ void GzipString( const RString &sIn, RString &sOut )
|
|||||||
sOut = mem.GetString();
|
sOut = mem.GetString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GunzipString( const RString &sIn, RString &sOut )
|
bool GunzipString( const RString &sIn, RString &sOut, RString &sError )
|
||||||
{
|
{
|
||||||
RageFileObjMem mem;
|
RageFileObjMem mem;
|
||||||
mem.PutString( sIn );
|
mem.PutString( sIn );
|
||||||
|
|
||||||
RString sError;
|
|
||||||
uint32_t iCRC32;
|
uint32_t iCRC32;
|
||||||
RageFileBasic *pFile = GunzipFile( mem, sError, &iCRC32 );
|
RageFileBasic *pFile = GunzipFile( mem, sError, &iCRC32 );
|
||||||
if( pFile == NULL )
|
if( pFile == NULL )
|
||||||
@@ -542,7 +541,10 @@ bool GunzipString( const RString &sIn, RString &sOut )
|
|||||||
SAFE_DELETE( pFile );
|
SAFE_DELETE( pFile );
|
||||||
|
|
||||||
if( iRet != iCRC32 )
|
if( iRet != iCRC32 )
|
||||||
|
{
|
||||||
|
sError = "CRC error";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ RageFileBasic *GunzipFile( RageFileBasic &file, RString &sError, uint32_t *iCRC3
|
|||||||
|
|
||||||
/* Quick helpers: */
|
/* Quick helpers: */
|
||||||
void GzipString( const RString &sIn, RString &sOut );
|
void GzipString( const RString &sIn, RString &sOut );
|
||||||
bool GunzipString( const RString &sIn, RString &sOut ); // returns false on CRC, etc. error
|
bool GunzipString( const RString &sIn, RString &sOut, RString &sError ); // returns false on CRC, etc. error
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user