term/protos: Do not call callback if NULL

This commit is contained in:
mintsuki 2022-04-17 07:51:28 +02:00
parent ac01423e58
commit 261ceecff4

View File

@ -553,12 +553,14 @@ failed_to_load_header_section:
if (terminal_hdr_tag->flags & (1 << 0)) {
// We provide callback
tag->flags |= (1 << 2);
if (terminal_hdr_tag->callback != 0) {
#if defined (__i386__)
term_callback = stivale2_term_callback;
stivale2_term_callback_ptr = terminal_hdr_tag->callback;
term_callback = stivale2_term_callback;
stivale2_term_callback_ptr = terminal_hdr_tag->callback;
#elif defined (__x86_64__)
term_callback = (void *)terminal_hdr_tag->callback;
term_callback = (void *)terminal_hdr_tag->callback;
#endif
}
}
// We provide max allowed string length