diff --git a/pcsx2/Recording/InputRecordingFile.cpp b/pcsx2/Recording/InputRecordingFile.cpp index beb86355dd..3ca2e39635 100644 --- a/pcsx2/Recording/InputRecordingFile.cpp +++ b/pcsx2/Recording/InputRecordingFile.cpp @@ -22,6 +22,7 @@ #include "common/FileSystem.h" #include "DebugTools/Debug.h" #include "MemoryTypes.h" +#include "svnrev.h" #include "SysForwardDefs.h" #include @@ -36,8 +37,13 @@ void InputRecordingFile::InputRecordingFileHeader::init() noexcept void InputRecordingFile::setEmulatorVersion() { - static const std::string emuVersion = fmt::format("PCSX2-{}.{}.{}", PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo); - strncpy(m_header.m_emulatorVersion, emuVersion.c_str(), sizeof(m_header.m_emulatorVersion) - 1); + std::string emuVersion; + if (!PCSX2_isReleaseVersion && GIT_TAGGED_COMMIT) + emuVersion = fmt::format("PCSX2-Nightly-{}", GIT_TAG); + else + emuVersion = fmt::format("PCSX2-{}.{}.{}", PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo); + + StringUtil::Strlcpy(m_header.m_emulatorVersion, emuVersion.c_str(), sizeof(m_header.m_emulatorVersion)); } void InputRecordingFile::setAuthor(const std::string& _author) diff --git a/pcsx2/Recording/InputRecordingFile.h b/pcsx2/Recording/InputRecordingFile.h index a03d2d5786..33a54ad879 100644 --- a/pcsx2/Recording/InputRecordingFile.h +++ b/pcsx2/Recording/InputRecordingFile.h @@ -33,7 +33,7 @@ class InputRecordingFile public: void init() noexcept; - } m_header; + } m_header = {}; public: