include warn_unused_result in ALLOC

pull/1347/head
nick black 4 years ago committed by Nick Black
parent 1b61786694
commit 602531ff33

@ -33,7 +33,7 @@ extern "C" {
#endif #endif
#define API __attribute__((visibility("default"))) #define API __attribute__((visibility("default")))
#define ALLOC __attribute__((malloc)) #define ALLOC __attribute__((malloc)) __attribute__((warn_unused_result))
// Get a human-readable string describing the running Notcurses version. // Get a human-readable string describing the running Notcurses version.
API const char* notcurses_version(void); API const char* notcurses_version(void);

@ -126,7 +126,9 @@ int runreels(struct notcurses* nc, struct ncreel* nr){
return 0; return 0;
case 'a':{ case 'a':{
auto tctx = new TabletCtx(); auto tctx = new TabletCtx();
ncreel_add(nr, nullptr, nullptr, tabletfxn, tctx); if(!ncreel_add(nr, nullptr, nullptr, tabletfxn, tctx)){
return -1;
}
break; break;
} }
case 'd': case 'd':

Loading…
Cancel
Save