diff options
Diffstat (limited to 'api/logic/minecraft/forge')
-rw-r--r-- | api/logic/minecraft/forge/ForgeXzDownload.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/api/logic/minecraft/forge/ForgeXzDownload.cpp b/api/logic/minecraft/forge/ForgeXzDownload.cpp index 4d94dd12..593aa24f 100644 --- a/api/logic/minecraft/forge/ForgeXzDownload.cpp +++ b/api/logic/minecraft/forge/ForgeXzDownload.cpp @@ -210,7 +210,8 @@ void ForgeXzDownload::decompressAndInstall() if (b.out_pos == sizeof(out)) { - if (pack200_file.write((char *)out, b.out_pos) != b.out_pos) + auto wresult = pack200_file.write((char *)out, b.out_pos); + if (wresult < 0 || size_t(wresult) != b.out_pos) { // msg = "Write error\n"; xz_dec_end(s); @@ -230,7 +231,8 @@ void ForgeXzDownload::decompressAndInstall() continue; } - if (pack200_file.write((char *)out, b.out_pos) != b.out_pos) + auto wresult = pack200_file.write((char *)out, b.out_pos); + if (wresult < 0 || size_t(wresult) != b.out_pos) { // write error pack200_file.close(); |