mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Fix buffer overflow in GuiTreeViewCtrl class.
When calculating test length (in method `GuiTreeViewCtrl::Item::getDisplayTextLength()`) the code doesn't take into account the `ItemState::Marked`, which adds additional char in `GuiTreeViewCtrl::Item::getDisplayText()` method. This commit fixes warning printed into console when calling `dSprintf()` as the buffer is now enough to fit all data.
This commit is contained in:
parent
6969531e2e
commit
93cea86312
1 changed files with 4 additions and 0 deletions
|
|
@ -466,6 +466,10 @@ U32 GuiTreeViewCtrl::Item::getDisplayTextLength()
|
|||
if( internalName && internalName[ 0 ] )
|
||||
len += dStrlen( internalName ) + 3; // ' [<internalname>]'
|
||||
}
|
||||
if( mState.test( Marked ) )
|
||||
{
|
||||
len += 1; // '*<name>'
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue