Ticket #1686: input-server-method.diff

File input-server-method.diff, 764 bytes (added by anthonylee, 16 years ago)

Fixed BInputServerMethod::SetIcon

  • src/servers/input/InputServerMethod.cpp

     
    159159    fMenu(NULL)
    160160{
    161161    fName = strdup(name);
    162     memcpy(fIcon, icon, 16*16*1);
     162    if (icon != NULL)
     163        memcpy(fIcon, icon, 16*16*1);
     164    else
     165        memset(fIcon, 0x1d, 16*16*1);
    163166}
    164167
    165168
     
    193196_BMethodAddOn_::SetIcon(const uchar* icon)
    194197{   
    195198    CALLED();
    196     memcpy(fIcon, icon, 16*16*1);
    197199
     200    if (icon != NULL)
     201        memcpy(fIcon, icon, 16*16*1);
     202    else
     203        memset(fIcon, 0x1d, 16*16*1);
     204
    198205    BMessage msg(IS_UPDATE_ICON);
    199206    msg.AddInt32("cookie", (uint32)fMethod);
    200207    msg.AddData("icon", B_RAW_TYPE, icon, 16*16*1);