From 581718f29a418d3068ae7859a62c71fb22482cb7 Mon Sep 17 00:00:00 2001 From: 0CBH0 Date: Sun, 24 Apr 2016 00:39:04 +0800 Subject: [PATCH] fix the bug that the compressed data can be broken. --- wiiurpxtool.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wiiurpxtool.cpp b/wiiurpxtool.cpp index 30207a3..5f95d5a 100644 --- a/wiiurpxtool.cpp +++ b/wiiurpxtool.cpp @@ -1,7 +1,3 @@ -// Copyright (C) 2016 0CBH0 -// Licensed under the terms of the GNU GPL, version 3 -// http://www.gnu.org/licenses/gpl-3.0.txt - #include #include #include @@ -331,7 +327,7 @@ int compress(FILE *in, FILE *out) { block_size = CHUNK; flush = Z_NO_FLUSH; - if(data_size < block_size) + if(data_size <= block_size) { block_size = data_size; flush = Z_FINISH; @@ -388,7 +384,7 @@ int main(int argc, char *argv[]) { if(argc != 3) { - printf("wiiurpxtool - version:1.0\n"); + printf("wiiurpxtool - version:1.1\n"); printf("Compress or decompress RPL/RPX files for Wii U\n\n"); printf("Usage:\n"); printf("decompress:\n");