Limit parsed colors to number of mIRC colors

Oh boy that's embarrassing.
weechat-hashes
Curtis McEnroe 2018-08-05 11:00:01 -04:00
parent 6df61b5dda
commit 7e02eddcf4
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 4 additions and 1 deletions

5
ui.c
View File

@ -102,7 +102,7 @@ void uiHide(void) {
endwin(); endwin();
printf( printf(
"This program is AGPLv3 free software!\n" "This program is AGPLv3 free software!\n"
"The source is available at <" SOURCE_URL ">\n" "The source is available at <" SOURCE_URL ">.\n"
); );
} }
@ -175,6 +175,9 @@ static const char *parseColor(struct AttrColor *color, const char *str) {
} }
if (bgLen) str = &str[1 + bgLen]; if (bgLen) str = &str[1 + bgLen];
fg &= 15;
bg &= 15;
if (color->pair == -1) color->pair = 0; if (color->pair == -1) color->pair = 0;
color->attr = MIRC_COLORS[fg].attr; color->attr = MIRC_COLORS[fg].attr;
color->pair = (color->pair & 070) | MIRC_COLORS[fg].pair; color->pair = (color->pair & 070) | MIRC_COLORS[fg].pair;