summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-color.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-12-19 07:06:01 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-12-19 07:06:01 +0100
commit5df4126c75e2b9ca61b086f6e0a996c85fd77c29 (patch)
tree10849806ab0dff25050bb1cdb8c8e17545a55102 /src/plugins/irc/irc-color.c
parent42113ebc0f51ef8a3fb907d4950cc7ad2e0c605b (diff)
downloadweechat-5df4126c75e2b9ca61b086f6e0a996c85fd77c29.zip
irc: return directly output of string_dyn_free without temporary variable
Diffstat (limited to 'src/plugins/irc/irc-color.c')
-rw-r--r--src/plugins/irc/irc-color.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c
index a286b3208..35c078dd4 100644
--- a/src/plugins/irc/irc-color.c
+++ b/src/plugins/irc/irc-color.c
@@ -95,7 +95,7 @@ regex_t *irc_color_regex_ansi = NULL;
char *
irc_color_decode (const char *string, int keep_colors)
{
- char **out, *result;
+ char **out;
char str_fg[3], str_bg[3], str_color[128], str_key[128], str_to_add[128];
const char *remapped_color;
unsigned char *ptr_string;
@@ -271,10 +271,7 @@ irc_color_decode (const char *string, int keep_colors)
weechat_string_dyn_concat (out, str_to_add, -1);
}
- result = *out;
- weechat_string_dyn_free (out, 0);
-
- return result;
+ return weechat_string_dyn_free (out, 0);
}
/*
@@ -289,7 +286,7 @@ irc_color_decode (const char *string, int keep_colors)
char *
irc_color_encode (const char *string, int keep_colors)
{
- char **out, *result;
+ char **out;
unsigned char *ptr_string;
int length;
@@ -398,10 +395,7 @@ irc_color_encode (const char *string, int keep_colors)
}
}
- result = *out;
- weechat_string_dyn_free (out, 0);
-
- return result;
+ return weechat_string_dyn_free (out, 0);
}
/*