Skip to content

Commit

Permalink
Fix a compliation warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
hokein committed Nov 6, 2015
1 parent a7be424 commit 84a91dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/zip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ bool AddFileToZip(zipFile zip_file, const std::string& absolute_path) {
FILE* file = fopen(absolute_path.c_str(), "rb");
if (!file)
return false;
int num_bytes;
size_t num_bytes;
char buf[zip::internal::kZipBufSize];

do {
num_bytes = fread(buf, sizeof(char), zip::internal::kZipBufSize, file);
if (num_bytes > 0) {
if (ZIP_OK != zipWriteInFileInZip(zip_file, buf, num_bytes))
if (ZIP_OK != zipWriteInFileInZip(
zip_file, buf, static_cast<unsigned int>(num_bytes)))
return false;
}
} while (num_bytes > 0);
Expand Down

0 comments on commit 84a91dc

Please sign in to comment.