Mercurial > audlegacy
changeset 247:95f7737919b1 trunk
[svn] Avoid discarding pointer type qualifiers by not using the result of gtk_entry_get_text directly.
author | chainsaw |
---|---|
date | Sat, 03 Dec 2005 08:17:14 -0800 |
parents | acae8fa925c3 |
children | e557fce67f47 |
files | Plugins/General/song_change/song_change.c |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugins/General/song_change/song_change.c Fri Dec 02 15:33:58 2005 -0800 +++ b/Plugins/General/song_change/song_change.c Sat Dec 03 08:17:14 2005 -0800 @@ -108,15 +108,18 @@ char *cmd, *cmd_after, *cmd_end; ConfigFile *cfgfile = xmms_cfg_open_default_file(); - cmd = gtk_entry_get_text(GTK_ENTRY(cmd_entry)); - cmd_after = gtk_entry_get_text(GTK_ENTRY(cmd_after_entry)); - cmd_end = gtk_entry_get_text(GTK_ENTRY(cmd_end_entry)); + cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_entry))); + cmd_after = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_after_entry))); + cmd_end = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_end_entry))); xmms_cfg_write_string(cfgfile, "song_change", "cmd_line", cmd); xmms_cfg_write_string(cfgfile, "song_change", "cmd_line_after", cmd_after); xmms_cfg_write_string(cfgfile, "song_change", "cmd_line_end", cmd_end); xmms_cfg_write_default_file(cfgfile); xmms_cfg_free(cfgfile); + g_free(cmd); + g_free(cmd_after); + g_free(cmd_end); if (timeout_tag) { @@ -200,15 +203,18 @@ { char *cmd, *cmd_after, *cmd_end; - cmd = gtk_entry_get_text(GTK_ENTRY(cmd_entry)); - cmd_after = gtk_entry_get_text(GTK_ENTRY(cmd_after_entry)); - cmd_end = gtk_entry_get_text(GTK_ENTRY(cmd_end_entry)); + cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_entry))); + cmd_after = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_after_entry))); + cmd_end = g_strdup(gtk_entry_get_text(GTK_ENTRY(cmd_end_entry))); if (check_command(cmd) < 0 || check_command(cmd_after) < 0 || check_command(cmd_end) < 0) warn_user(); else save_and_close(NULL, NULL); + g_free(cmd); + g_free(cmd_after); + g_free(cmd_end); }