diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-19 07:06:01 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-12-19 07:06:01 +0100 |
commit | 5df4126c75e2b9ca61b086f6e0a996c85fd77c29 (patch) | |
tree | 10849806ab0dff25050bb1cdb8c8e17545a55102 /src/plugins | |
parent | 42113ebc0f51ef8a3fb907d4950cc7ad2e0c605b (diff) | |
download | weechat-5df4126c75e2b9ca61b086f6e0a996c85fd77c29.zip |
irc: return directly output of string_dyn_free without temporary variable
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-color.c | 14 | ||||
-rw-r--r-- | src/plugins/irc/irc-tag.c | 14 |
2 files changed, 8 insertions, 20 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); } /* diff --git a/src/plugins/irc/irc-tag.c b/src/plugins/irc/irc-tag.c index c70e03c73..af8f21063 100644 --- a/src/plugins/irc/irc-tag.c +++ b/src/plugins/irc/irc-tag.c @@ -49,7 +49,7 @@ char * irc_tag_escape_value (const char *string) { - char **out, *result; + char **out; unsigned char *ptr_string; int length; @@ -98,10 +98,7 @@ irc_tag_escape_value (const char *string) } } - result = *out; - weechat_string_dyn_free (out, 0); - - return result; + return weechat_string_dyn_free (out, 0); } /* @@ -115,7 +112,7 @@ irc_tag_escape_value (const char *string) char * irc_tag_unescape_value (const char *string) { - char **out, *result; + char **out; unsigned char *ptr_string; int length; @@ -182,10 +179,7 @@ irc_tag_unescape_value (const char *string) } } - result = *out; - weechat_string_dyn_free (out, 0); - - return result; + return weechat_string_dyn_free (out, 0); } /* |