}
terminal_hl_t * term_hl = (terminal_hl_t*)attributes;
- if (term_hl->attribute) {
- fputs(term_hl->attribute, stdout);
- }
- if (term_hl->foreground_color) {
- fputs(term_hl->foreground_color, stdout);
+ if (term_hl) {
+ if (term_hl->attribute) {
+ fputs(term_hl->attribute, stdout);
+ }
+ if (term_hl->foreground_color) {
+ fputs(term_hl->foreground_color, stdout);
+ }
}
for (int i = 0; i < length; i++) {
putchar(*(string+i));