forked from PsychoticNinja/irssi
don't crash with themes without replaces block. don't crash with themes with
highascii characters. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1422 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
fa82a26cc6
commit
7ed4e7ee7c
@ -161,7 +161,7 @@ static void theme_format_append_next(THEME_REC *theme, GString *str,
|
||||
int flags)
|
||||
{
|
||||
int index;
|
||||
char chr;
|
||||
unsigned char chr;
|
||||
|
||||
chr = **format;
|
||||
if ((chr == '$' || chr == '%') &&
|
||||
@ -481,14 +481,14 @@ static void theme_read_replaces(CONFIG_REC *config, THEME_REC *theme)
|
||||
const char *p;
|
||||
int index;
|
||||
|
||||
node = config_node_traverse(config, "replaces", FALSE);
|
||||
if (node == NULL || node->type != NODE_TYPE_BLOCK) return;
|
||||
|
||||
/* reset replace keys */
|
||||
for (index = 0; index < 256; index++)
|
||||
theme->replace_keys[index] = -1;
|
||||
index = 0;
|
||||
|
||||
node = config_node_traverse(config, "replaces", FALSE);
|
||||
if (node == NULL || node->type != NODE_TYPE_BLOCK) return;
|
||||
|
||||
for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
|
||||
node = tmp->data;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user