dont segfault on empty token "match"
This commit is contained in:
parent
dcdd3abb8c
commit
55ffd41892
@ -16,12 +16,14 @@ void cterm_render_callback(const char * const string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
terminal_hl_t * term_hl = (terminal_hl_t*)attributes;
|
terminal_hl_t * term_hl = (terminal_hl_t*)attributes;
|
||||||
|
if (term_hl) {
|
||||||
if (term_hl->attribute) {
|
if (term_hl->attribute) {
|
||||||
fputs(term_hl->attribute, stdout);
|
fputs(term_hl->attribute, stdout);
|
||||||
}
|
}
|
||||||
if (term_hl->foreground_color) {
|
if (term_hl->foreground_color) {
|
||||||
fputs(term_hl->foreground_color, stdout);
|
fputs(term_hl->foreground_color, stdout);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
putchar(*(string+i));
|
putchar(*(string+i));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user