diff --git a/src/s3plugin.cpp b/src/s3plugin.cpp index 4cd63f4..368b323 100644 --- a/src/s3plugin.cpp +++ b/src/s3plugin.cpp @@ -1225,8 +1225,8 @@ UploadOutcome InitiateAppend(Writer& writer, size_t source_bytes_to_copy) int64_t start_range = 0; while (source_bytes_to_copy > Writer::buff_min_) { - const size_t copy_count = - source_bytes_to_copy > Writer::buff_max_ ? Writer::buff_max_ : source_bytes_to_copy; + const int64_t copy_count = + source_bytes_to_copy > Writer::buff_max_ ? Writer::buff_max_ : static_cast(source_bytes_to_copy); // peculiarity of AWS: the range for the copy request has an inclusive end, // meaning that the bytes numbered start_range to end_range included are copied diff --git a/test/drivertest.cpp b/test/drivertest.cpp index 3858e6a..32b0320 100644 --- a/test/drivertest.cpp +++ b/test/drivertest.cpp @@ -126,8 +126,11 @@ int launch_test(const char *inputFilename, int nBufferSize) { << boost::uuids::random_generator()() << "/output.txt"; std::stringstream localOutput; #ifdef _WIN32 - localOutput << std::getenv("TEMP") << "\\out-" - << boost::uuids::random_generator()() << ".txt"; + size_t len; + char tempValue[2048]; + getenv_s(&len, tempValue, 2048, "TEMP"); + localOutput << tempValue << "\\out-" << boost::uuids::random_generator()() + << ".txt"; #else localOutput << "/tmp/out-" << boost::uuids::random_generator()() << ".txt"; #endif @@ -334,9 +337,9 @@ int copyFileWithFseek(const char *file_name_input, const char *file_name_output, // Reads the file by steps of nBufferSize and writes to the output file at // each step char *buffer = new char[nBufferSize + 1](); - long long int sizeRead = nBufferSize; - long long int sizeWrite; - int cummulativeRead = 0; + long long sizeRead = nBufferSize; + long long sizeWrite; + long long cummulativeRead = 0; driver_fseek(fileinput, 0, SEEK_SET); while (sizeRead == nBufferSize && copy_status == kSuccess) { driver_fseek(fileinput, cummulativeRead, SEEK_SET);