Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Bugfix: GZCompressFile() and GZDecompressFile() not crashing on files bigger than 2 GB
Bugfix: GZCompressFile() and GZDecompressFile() not crashing on files bigger than 2 GB [message #52828] Sun, 08 December 2019 02:28 Go to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
 bool GZCompressFile(const char *dstfile, const char *srcfile, Gate<int64, int64>progress)
 {
 	FileIn in(srcfile);
 	if(!in)
 		return false;
 	FileOut out(dstfile);
 	if(!out)
 		return false;
-	if(GZCompress(out, in, (int)in.GetLeft(), progress) < 0)
+	if(GZCompress(out, in, in.GetLeft(), progress) < 0)
 		return false;
 	out.Close();
 	return !out.IsError();
 }


 bool GZDecompressFile(const char *dstfile, const char *srcfile, Gate<int64, int64>progress)
 {
 	FileIn in(srcfile);
 	if(!in)
 		return false;
 	FileOut out(dstfile);
 	if(!out)
 		return false;
-	if(GZDecompress(out, in, (int)in.GetLeft(), progress) < 0)
+	if(GZDecompress(out, in, in.GetLeft(), progress) < 0)
 		return false;
 	out.Close();
 	return !out.IsError();
 }


Tested with MSC2017 32 bit

[Updated on: Sun, 08 December 2019 02:29]

Report message to a moderator

Re: Bugfix: GZCompressFile() and GZDecompressFile() not crashing on files bigger than 2 GB [message #52831 is a reply to message #52828] Sun, 08 December 2019 08:47 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, applied.
Previous Topic: AMap::Trim(int n)
Next Topic: Bugfix AsGate64() works correctly on totals > 2^31
Goto Forum:
  


Current Time: Fri Mar 29 11:57:11 CET 2024

Total time taken to generate the page: 0.01288 seconds