The parameter passed to BInputServerMethod:SetIcon() can be NULL. Patch

by Anthony Lee. Thank you! Fixes bug #1686. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23202 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2008-01-01 14:42:27 +00:00
parent 4b812f294e
commit 691b2922a6
+9 -2
View File
@@ -159,7 +159,10 @@ _BMethodAddOn_::_BMethodAddOn_(BInputServerMethod *method, const char *name,
fMenu(NULL)
{
fName = strdup(name);
memcpy(fIcon, icon, 16*16*1);
if (icon != NULL)
memcpy(fIcon, icon, 16*16*1);
else
memset(fIcon, 0x1d, 16*16*1);
}
@@ -193,7 +196,11 @@ status_t
_BMethodAddOn_::SetIcon(const uchar* icon)
{
CALLED();
memcpy(fIcon, icon, 16*16*1);
if (icon != NULL)
memcpy(fIcon, icon, 16*16*1);
else
memset(fIcon, 0x1d, 16*16*1);
BMessage msg(IS_UPDATE_ICON);
msg.AddInt32("cookie", (uint32)fMethod);