From 397221b94a8d384c237e548b0ab2afb50e77e7d0 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 16 Apr 2023 22:24:10 +0200 Subject: [PATCH] Codechange: Make ScenarioIdentifier use std::string for the filename --- src/fios.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fios.cpp b/src/fios.cpp index 4ac6a6798f..6bc09d3619 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -632,7 +632,7 @@ const char *FiosGetScreenshotDir() struct ScenarioIdentifier { uint32 scenid; ///< ID for the scenario (generated by content). uint8 md5sum[16]; ///< MD5 checksum of file. - char filename[MAX_PATH]; ///< filename of the file. + std::string filename; ///< filename of the file. bool operator == (const ScenarioIdentifier &other) const { @@ -676,7 +676,7 @@ public: int fret = fscanf(f, "%u", &id.scenid); FioFCloseFile(f); if (fret != 1) return false; - strecpy(id.filename, filename.c_str(), lastof(id.filename)); + id.filename = filename; Md5 checksum; uint8 buffer[1024]; @@ -718,7 +718,7 @@ const char *FindScenario(const ContentInfo *ci, bool md5sum) for (ScenarioIdentifier &id : _scanner) { if (md5sum ? (memcmp(id.md5sum, ci->md5sum, sizeof(id.md5sum)) == 0) : (id.scenid == ci->unique_id)) { - return id.filename; + return id.filename.c_str(); } }