Terminal (Windows): fix file version detection

This commit is contained in:
李通洲
2025-03-30 16:38:54 +08:00
parent e05ac797cc
commit f34d51dddc
+3 -1
View File
@@ -22,9 +22,11 @@
static bool getFileVersion(const FFstrbuf* exePath, const wchar_t* stringName, FFstrbuf* version)
{
wchar_t exePathW[PATH_MAX];
wchar_t exePathW[PATH_MAX + 1];
int len = MultiByteToWideChar(CP_UTF8, 0, exePath->chars, (int)exePath->length, exePathW, ARRAY_SIZE(exePathW));
if (len <= 0) return false;
assert(len < (int) ARRAY_SIZE(exePathW));
exePathW[len] = L'\0';
return ffGetFileVersion(exePathW, stringName, version);
}