update Lzma86.h : fix typo
A free file archiver for extremely high compression
Brought to you by:
ipavlov
In the comment of the Lzma86_Encode() method, the Return code type may be SZ_ERROR_FAIL, so we should also add SZ_ERROR_FAIL in comment, which seems more rigorous.
Lzma86.h file in line 56:
/*
Lzma86_Encode
-------------
Return code:
SZ_OK - OK
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_PARAM - Incorrect paramater
SZ_ERROR_OUTPUT_EOF - output buffer overflow
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
*/
In fact:
Lzma86_Encode(){
...
LzmaEncode(){
...
LzmaEnc_MemEncode(){
...
res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig);
if (res == SZ_OK)
{
res = LzmaEnc_Encode2(p, progress);
if (res == SZ_OK && p->nowPos64 != srcLen)
res = SZ_ERROR_FAIL;
}
...
}
...
}
...
}
Last edit: Bruce Stark 2019-07-16
I suppose that this error case can mean some internal failure in 7-Zip source code.
So it's impossible to get that return value code.
We just use that check to ensure that the internal code worked as expected.
Thanks for your reply.
I suppose if it's impossible to get that return value code here, then it's unnecessary to add a judgment statement.
By the way, what are some internal failure in 7-Zip source code?
Source code can have bugs or errors.
And it's better to show some return code, if something doesn't work as expected.
If you get such failure for some data, you must stop using that code and report developers about that problem.
It's unusual situation in most cases.
Last edit: Igor Pavlov 2019-07-17
ok,I see. Please close the ticket . Thanks again.
Last edit: Bruce Stark 2019-07-29