From 7ed4e7ee7c2679ab775ae36a30bdd93e34ff67cb Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 24 Mar 2001 16:03:05 +0000 Subject: [PATCH] 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 --- src/fe-common/core/themes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index ee053cd5..ac077d9d 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -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;