Refactor/Improve String and Path Handling

This commit is contained in:
LRFLEW committed 2016-10-09 15:29:58 -05:00
1 parent 211a0d7863
commit e5ff7412e4
94 files changed
+1038 -989

No files matched your search

+4 -3
View File
@@ -46,6 +46,7 @@ extern "C"
#include "../platform/platform.h"
#include "../scenario.h"
#include "../util/sawyercoding.h"
#include "../util/util.h"
}
constexpr uint16 OBJECT_REPOSITORY_VERSION = 10;
@@ -634,8 +635,8 @@ private:
static void GetRepositoryPath(utf8 * buffer, size_t bufferSize)
{
platform_get_user_directory(buffer, nullptr);
strcat(buffer, "objects.idx");
platform_get_user_directory(buffer, nullptr, bufferSize);
safe_strcat_path(buffer, "objects.idx", bufferSize);
}
static void GetRCT2ObjectPath(utf8 * buffer, size_t bufferSize)
@@ -645,7 +646,7 @@ private:
static void GetUserObjectPath(utf8 * buffer, size_t bufferSize)
{
platform_get_user_directory(buffer, "object");
platform_get_user_directory(buffer, "object", bufferSize);
}
static uint32 GetPathChecksum(const utf8 * path)