summary refs log tree commit diff stats
path: root/src/common/plugin.c
diff options
context:
space:
mode:
authorArnavion <arnavion@gmail.com>2015-01-14 21:38:19 -0800
committerArnavion <arnavion@gmail.com>2015-01-14 21:38:19 -0800
commite400ed28552d8f52a558b73345fc55677905ef9e (patch)
treec9ea092797919dd6f697db06bcd4c1f0c64280b4 /src/common/plugin.c
parent1d316710ed7699a43ffe8a889da7680cbb2d57f3 (diff)
Fixed bad const-cast.
Diffstat (limited to 'src/common/plugin.c')
-rw-r--r--src/common/plugin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 1cc393ea..b0eef41d 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -970,6 +970,7 @@ hexchat_printf (hexchat_plugin *ph, const char *format, ...)
 void
 hexchat_command (hexchat_plugin *ph, const char *command)
 {
+	char *command_nonconst;
 	char *conv;
 	gssize len = -1;
 
@@ -980,9 +981,11 @@ hexchat_command (hexchat_plugin *ph, const char *command)
 	}
 
 	/* scripts/plugins continue to send non-UTF8... *sigh* */
-	conv = text_validate ((char **)&command, &len);
-	handle_command (ph->context, (char *)command, FALSE);
+	command_nonconst = g_strdup (command);
+	conv = text_validate (&command_nonconst, &len);
+	handle_command (ph->context, command_nonconst, FALSE);
 	g_free (conv);
+	g_free (command_nonconst);
 }
 
 void