notcurses_init: properly check flags for unknowns

pull/690/head
nick black 4 years ago
parent 3668b201af
commit 6e7996f1a8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -735,7 +735,7 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){
fprintf(stderr, "Provided an illegal negative margin, refusing to start\n");
return NULL;
}
if(opts->flags > NCOPTION_NO_ALTERNATE_SCREEN){
if(opts->flags > (NCOPTION_NO_ALTERNATE_SCREEN << 1u)){
fprintf(stderr, "Provided an illegal Notcurses option, refusing to start\n");
return NULL;
}

@ -16,6 +16,9 @@ int main(int argc, char** argv){
.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN,
};
struct notcurses* nc = notcurses_init(&nopts, NULL);
if(nc == NULL){
return EXIT_FAILURE;
}
struct ncplane* std = notcurses_stdplane(nc);
// FIXME not all work yet; this subset does
const int blitters[] = {

Loading…
Cancel
Save