Merge pull request #1959 from heinrich5991/pr_fix_themecrash

Fix `str_truncate` call in theme scan
This commit is contained in:
oy 2019-01-07 19:49:40 +01:00 committed by GitHub
commit efc844e668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -593,12 +593,12 @@ int CMenus::ThemeScan(const char *pName, int IsDir, int DirType, void *pUser)
bool IsNight = false;
if((pSuffix = str_endswith(aFullName, "_day")))
{
str_truncate(aThemeName, sizeof(aThemeName), pName, pSuffix - aThemeName);
str_truncate(aThemeName, sizeof(aThemeName), pName, pSuffix - aFullName);
IsDay = true;
}
else if((pSuffix = str_endswith(aFullName, "_night")))
{
str_truncate(aThemeName, sizeof(aThemeName), pName, pSuffix - aThemeName);
str_truncate(aThemeName, sizeof(aThemeName), pName, pSuffix - aFullName);
IsNight = true;
}
else