Fixed a possible buffer overflow (thanks Axel). Removed a todo item
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13236 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
755e899559
commit
ba69a3795b
@ -366,9 +366,7 @@ BMenuItem::DrawContent()
|
||||
if (fBounds.Width() > labelWidth)
|
||||
fSuper->DrawString(fLabel);
|
||||
else {
|
||||
// TODO: Ouch! Allocating the string every time
|
||||
// isn't exactly cheap.
|
||||
char *truncatedLabel = new char[strlen(fLabel) + 1];
|
||||
char *truncatedLabel = new char[strlen(fLabel) + 4];
|
||||
TruncateLabel(fBounds.Width(), truncatedLabel);
|
||||
fSuper->DrawString(truncatedLabel);
|
||||
delete[] truncatedLabel;
|
||||
|
Loading…
Reference in New Issue
Block a user