Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_SliderData is memset zero twice in Gadget_List_Box_Create_Scroll_Bar #1097

Open
xezon opened this issue Feb 8, 2024 · 0 comments
Open

_SliderData is memset zero twice in Gadget_List_Box_Create_Scroll_Bar #1097

xezon opened this issue Feb 8, 2024 · 0 comments

Comments

@xezon
Copy link
Contributor

xezon commented Feb 8, 2024

_SliderData is memset zero twice in Gadget_List_Box_Create_Scroll_Bar. It is not used between both invocations. The second memset can be removed.

void Gadget_List_Box_Create_Scroll_Bar(GameWindow *list_box)
{
    _ListboxData *data = static_cast<_ListboxData *>(list_box->Win_Get_User_Data());
    WinInstanceData instance_data;
    _SliderData slider_data;
    memset(&slider_data, 0, sizeof(slider_data));
    int status = list_box->Win_Get_Status();
    bool has_text = false;

...

    memset(&slider_data, 0, sizeof(slider_data));
    data->m_slider = g_theWindowManager->Go_Go_Gadget_Slider(list_box,
        status | WIN_STATUS_ENABLED | WIN_STATUS_ACTIVE,
        width - i3 - 2,
        top + i4 + 3,
        i3,
        bottom - 2 * i4 - 6,
        &instance_data,
        &slider_data,
        nullptr,
        true);
    data->m_scrollBar = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant