Skip to content

Fix initialization of union - #631

Merged
mahkoh merged 3 commits into
cmus:masterfrom
jayay:unitialized-mem
Feb 5, 2017
Merged

mahkoh merged 3 commits into
cmus:masterfrom
jayay:unitialized-mem

Conversation

@jayay

@jayay jayay commented Feb 5, 2017

Copy link
Copy Markdown
Contributor

I just discovered the expr struct isn't being fully initialized.

@mahkoh

mahkoh commented Feb 5, 2017

Copy link
Copy Markdown
Member

Just use xnew0.

@jayay

jayay commented Feb 5, 2017

Copy link
Copy Markdown
Contributor Author

Oh, sure!

Comment thread expr.c Outdated
new->key = NULL;
new->parent = NULL;
new->left = NULL;
new->right = NULL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this.

@mahkoh
mahkoh merged commit 055094c into cmus:master Feb 5, 2017
@jayay
jayay deleted the unitialized-mem branch February 5, 2017 12:25
@flyingmutant flyingmutant mentioned this pull request Feb 8, 2017
3 of 9 tasks
mahkoh pushed a commit to mahkoh/cmus that referenced this pull request Apr 29, 2017
* fix initialization of union

* Use xnew0 instead of manual initialization

* no need for seperate zeroing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants