Skip to content

Commit

Permalink
Fixed mismatched cast typing on source file implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Feb 10, 2025
1 parent 7651523 commit 95c5ac6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/quoneq/ftp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ size_t quoneq_ftp_client::write_file_callback(
std::ofstream* stream
) {
size_t total = size * nmemb;
stream->write(static_cast<char*>(ptr), total);
stream->write(
static_cast<char*>(ptr),
static_cast<std::streamsize>(total)
);

return total;
}
Expand All @@ -57,8 +60,12 @@ size_t quoneq_ftp_client::read_file_callback(
if(!stream->good())
return 0;

stream->read(static_cast<char*>(ptr), size * nmemb);
return stream->gcount();
stream->read(
static_cast<char*>(ptr),
static_cast<std::streamsize>(size * nmemb)
);

return static_cast<size_t>(stream->gcount());
}

std::string quoneq_ftp_client::extract_ftp_path(const std::string &ftp_url) {
Expand Down
5 changes: 4 additions & 1 deletion src/quoneq/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ size_t quoneq_http_client::write_file_callback(
std::ofstream* file
) {
size_t total_size = size * nmemb;
file->write((char*)contents, total_size);
file->write(
(char*)contents,
static_cast<std::streamsize>(total_size)
);

return total_size;
}
Expand Down

0 comments on commit 95c5ac6

Please sign in to comment.