fix for strncpy with std::filesystem::path on windows
This commit is contained in:
@@ -72,7 +72,7 @@ dialog_tick(Dialog* self)
|
|||||||
std::filesystem::path baseDirectory = std::filesystem::current_path();
|
std::filesystem::path baseDirectory = std::filesystem::current_path();
|
||||||
std::filesystem::path relativePathString = std::filesystem::relative(self->path, baseDirectory);
|
std::filesystem::path relativePathString = std::filesystem::relative(self->path, baseDirectory);
|
||||||
|
|
||||||
strncpy(relativePath, relativePathString.c_str(), PATH_MAX - 1);
|
strncpy(relativePath, relativePathString.string().c_str(), PATH_MAX - 1);
|
||||||
|
|
||||||
switch (self->type)
|
switch (self->type)
|
||||||
{
|
{
|
||||||
|
@@ -57,7 +57,7 @@ init(State* state)
|
|||||||
|
|
||||||
memset(state->startPath, '\0', PATH_MAX - 1);
|
memset(state->startPath, '\0', PATH_MAX - 1);
|
||||||
|
|
||||||
strncpy(state->startPath, startPath.c_str(), PATH_MAX - 1);
|
strncpy(state->startPath, startPath.string().c_str(), PATH_MAX - 1);
|
||||||
|
|
||||||
settings_load(&state->settings);
|
settings_load(&state->settings);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user