Skip to content
Browse files

GeniusPaste: Fix misuse of g_strlcat() and simplify the code

  • Loading branch information...
1 parent 5d48b6c commit e05f1d6624db0deae08d4300630338910ba3c47e @codebrainz codebrainz committed with b4n
Showing with 2 additions and 4 deletions.
  1. +2 −4 geniuspaste/src/geniuspaste.c
View
6 geniuspaste/src/geniuspaste.c
@@ -377,10 +377,8 @@ static void paste(GeanyDocument * doc, const gchar * website)
* e.g. sprunge.us/xxxx?c
*/
gchar *ft_tmp = g_ascii_strdown(f_type, -1);
- p_url[strlen(p_url) - 1] = '\0';
- temp_body = g_strdup_printf("?%s", ft_tmp);
- g_strlcat(p_url + 1, temp_body, -1);
- p_url = g_strstrip(p_url);
+ temp_body = g_strstrip(p_url);
+ p_url = g_strdup_printf("%s?%s", temp_body, ft_tmp);
g_free(temp_body);
g_free(ft_tmp);
}

0 comments on commit e05f1d6

Please sign in to comment.
Something went wrong with that request. Please try again.