Skip to content

Commit 95c5ac6

Browse files
committed
Fixed mismatched cast typing on source file implementations.
1 parent 7651523 commit 95c5ac6

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/quoneq/ftp.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ size_t quoneq_ftp_client::write_file_callback(
4545
std::ofstream* stream
4646
) {
4747
size_t total = size * nmemb;
48-
stream->write(static_cast<char*>(ptr), total);
48+
stream->write(
49+
static_cast<char*>(ptr),
50+
static_cast<std::streamsize>(total)
51+
);
4952

5053
return total;
5154
}
@@ -57,8 +60,12 @@ size_t quoneq_ftp_client::read_file_callback(
5760
if(!stream->good())
5861
return 0;
5962

60-
stream->read(static_cast<char*>(ptr), size * nmemb);
61-
return stream->gcount();
63+
stream->read(
64+
static_cast<char*>(ptr),
65+
static_cast<std::streamsize>(size * nmemb)
66+
);
67+
68+
return static_cast<size_t>(stream->gcount());
6269
}
6370

6471
std::string quoneq_ftp_client::extract_ftp_path(const std::string &ftp_url) {

src/quoneq/http.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ size_t quoneq_http_client::write_file_callback(
4545
std::ofstream* file
4646
) {
4747
size_t total_size = size * nmemb;
48-
file->write((char*)contents, total_size);
48+
file->write(
49+
(char*)contents,
50+
static_cast<std::streamsize>(total_size)
51+
);
4952

5053
return total_size;
5154
}

0 commit comments

Comments
 (0)