UncompressMemory - detailed error handling

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

UncompressMemory - detailed error handling

Post by Lebostein »

At the moment UncompressMemory() returns -1 if the data could not be uncompressed.

My wish:
result = -1: no valid compressed data (decompression algorithm can not start)
result = -2: output buffer to small (decompression algorithm reaches the end of the writeable output buffer)

In case of result = -2 it would be possible to increase the buffer to start a new trial. At the moment I am not sure if the data are invalid or the output buffer to small.