Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
fix #31, 7z extraction bug
Browse files Browse the repository at this point in the history
terrible overlook, wonder why there were no warning
  • Loading branch information
LiquidFenrir committed Jun 27, 2017
1 parent 2a0abe1 commit 7aa8c58
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,14 @@ Result extractFileFrom7z(const char * archive_file, const char * filename, const

Handle filehandle;
u32 bytesWritten = 0;
u64 offset = 0;

ret = openFile(filepath, &filehandle, true);
if (ret != 0) {
printf("Error: couldn't open file to write.\n");
return EXTRACTION_ERROR_WRITEFILE;
}

ret = writeFile(filehandle, &bytesWritten, offset, buf+offset, (u32)fileSize);
ret = writeFile(filehandle, &bytesWritten, 0, buf+offset, (u32)fileSize);
closeFile(filehandle);

free(buf);
Expand Down

0 comments on commit 7aa8c58

Please sign in to comment.