diff --git a/src/core/settings.c b/src/core/settings.c index af6e5ee6..5db3c790 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -208,15 +208,16 @@ void sig_term(int n) static CONFIG_REC *parse_configfile(const char *fname) { CONFIG_REC *config; - char *str; + char *real_fname; - str = fname != NULL ? g_strdup(fname) : + real_fname = fname != NULL ? g_strdup(fname) : g_strdup_printf("%s/.irssi/config", g_get_home_dir()); - config = config_open(str, -1); - g_free(str); + config = config_open(real_fname, -1); - if (config == NULL && *fname != '\0') + if (config == NULL && fname != NULL) { + g_free(real_fname); return NULL; /* specified config file not found */ + } if (config != NULL) config_parse(config); @@ -233,9 +234,10 @@ static CONFIG_REC *parse_configfile(const char *fname) config_parse_data(config, default_config, "internal"); } - config_change_file_name(config, fname, 0660); + config_change_file_name(config, real_fname, 0660); } + g_free(real_fname); return config; } diff --git a/src/core/signals.c b/src/core/signals.c index cbd92d45..8ab313bb 100644 --- a/src/core/signals.c +++ b/src/core/signals.c @@ -224,7 +224,7 @@ static int signal_emitv_id(int signal_id, int params, va_list va) arglist[0] = GINT_TO_POINTER(signal_id); for (n = 1; n < 8; n++) - arglist[n] = n >= params ? NULL : va_arg(va, gconstpointer); + arglist[n] = n > params ? NULL : va_arg(va, gconstpointer); /* send "signal" */ if (first_signal_rec != NULL) {