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(); } }