mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Block unsafe fs::path std::string conversion calls
There is no change in behavior. This just helps prepare for the transition from boost::filesystem to std::filesystem by avoiding calls to methods which will be unsafe after the transaction to std::filesystem to due lack of a boost::filesystem::path::imbue equivalent and inability to set a predictable locale. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Co-authored-by: Kiminuo <kiminuo@protonmail.com> Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
@@ -41,11 +41,11 @@ FILE* FlatFileSeq::Open(const FlatFilePos& pos, bool read_only)
|
||||
if (!file && !read_only)
|
||||
file = fsbridge::fopen(path, "wb+");
|
||||
if (!file) {
|
||||
LogPrintf("Unable to open file %s\n", path.string());
|
||||
LogPrintf("Unable to open file %s\n", fs::PathToString(path));
|
||||
return nullptr;
|
||||
}
|
||||
if (pos.nPos && fseek(file, pos.nPos, SEEK_SET)) {
|
||||
LogPrintf("Unable to seek to position %u of %s\n", pos.nPos, path.string());
|
||||
LogPrintf("Unable to seek to position %u of %s\n", pos.nPos, fs::PathToString(path));
|
||||
fclose(file);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user