Fix download path generation

This commit is contained in:
Tixx
2025-06-19 17:56:59 +02:00
parent 51d096deac
commit 8025c0884f
5 changed files with 23 additions and 24 deletions

View File

@@ -6,6 +6,7 @@
#pragma once
#include <filesystem>
#include <string>
#ifdef __linux__
@@ -29,7 +30,7 @@ extern bool Terminate;
extern uint64_t UDPSock;
extern uint64_t TCPSock;
extern std::string Branch;
extern std::string CachingDirectory;
extern std::filesystem::path CachingDirectory;
extern bool deleteDuplicateMods;
extern bool TCPTerminate;
extern std::string LastIP;

View File

@@ -200,11 +200,11 @@ inline std::wstring ToWString(const std::string& s) {
throw std::runtime_error("EVP_DigestInit_ex2() failed");
}
std::wifstream stream(filename, std::ios::binary);
std::ifstream stream(filename, std::ios::binary);
const size_t FileSize = std::filesystem::file_size(filename);
size_t Read = 0;
std::vector<wchar_t> Data;
std::vector<char> Data;
while (Read < FileSize) {
Data.resize(size_t(std::min<size_t>(FileSize - Read, 4096)));
size_t RealDataSize = Data.size();