[nctabbed] NULL guards around trivalent nctabbed_channels()

This commit is contained in:
nick black 2021-03-24 17:57:56 -04:00
parent c677a4fd8a
commit 37a12e4273
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -364,9 +364,15 @@ nctab* nctabbed_select(nctabbed* nt, nctab* t){
void nctabbed_channels(nctabbed* nt, uint64_t* RESTRICT hdrchan,
uint64_t* RESTRICT selchan, uint64_t* RESTRICT sepchan){
memcpy(&nt->opts.hdrchan, hdrchan, sizeof(*hdrchan));
memcpy(&nt->opts.selchan, selchan, sizeof(*selchan));
memcpy(&nt->opts.sepchan, sepchan, sizeof(*sepchan));
if(hdrchan){
memcpy(&nt->opts.hdrchan, hdrchan, sizeof(*hdrchan));
}
if(selchan){
memcpy(&nt->opts.selchan, selchan, sizeof(*selchan));
}
if(sepchan){
memcpy(&nt->opts.sepchan, sepchan, sizeof(*sepchan));
}
}
const char* nctabbed_separator(nctabbed* nt){