Skip to content

Initialize notcurses_options struct #8

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dankamongmen
Copy link

The notcurses_options struct needs be zeroed out in its entirety. This construction both future-proofs us, and remedies current use of uninitialized memory (as of 1.3.5-pre, there are loglevel, margin_X, and flags). Closes #7 .

Without brace initialization, we were allowing random data
into the notcurses_options struct. This manifested as a spasm
of valgrind warnings, and sometimes SIGSEGVs on startup. With
this change, I don't see them anymore.
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.

Segfault on startup (sometimes)
1 participant