mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Merge pull request #1959 from heinrich5991/pr_fix_themecrash
Fix `str_truncate` call in theme scan
This commit is contained in:
commit
efc844e668
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue