Skip to content

Commit

Permalink
fix: conditional jump or move depends on uninitialised value(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-soft committed May 30, 2021
1 parent 9f4e72e commit 7174868
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/widget_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ LCUI_Widget LCUIWidget_GetFocus(void)
int LCUIWidget_SetFocus(LCUI_Widget widget)
{
LCUI_Widget w;
LCUI_WidgetEventRec ev;
LCUI_WidgetEventRec ev = { 0 };

for (w = widget; w; w = w->parent) {
if (Widget_Focusable(w)) {
Expand Down
2 changes: 2 additions & 0 deletions src/platform/linux/linux_x11display.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ static void X11Surface_ClearTasks(LCUI_Surface surface)
static void OnDestroySurface(void *data)
{
LCUI_Surface s = data;

X11Surface_ClearTasks(s);
LinkedList_Clear(&s->rects, free);
if (s->ximage) {
XDestroyImage(s->ximage);
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_scrollbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int BuildContentViewFromXML(void)
void test_scrollbar(void)
{
float left, top;
LCUI_SysEventRec e;
LCUI_SysEventRec e = { 0 };
LCUI_Widget content;

LCUI_Init();
Expand Down

0 comments on commit 7174868

Please sign in to comment.