diff libaudacious/beepctrl.c @ 1448:3b1c464cbbb0 trunk

[svn] Seems safer to me to free this way, assuming I'm not misreading. Hey. At least it doesn't crash.
author nemo
date Fri, 28 Jul 2006 07:21:20 -0700
parents 7ca5bef8d9ee
children 9bb6d5ce6d95
line wrap: on
line diff
--- a/libaudacious/beepctrl.c	Fri Jul 28 02:27:19 2006 -0700
+++ b/libaudacious/beepctrl.c	Fri Jul 28 07:21:20 2006 -0700
@@ -353,10 +353,10 @@
     gchar *tmp = g_strdup(in);
 
     /* split out the host/port and key */
-    tmp += 6;
     workbuf = tmp;
+    workbuf += 6;
 
-    keybuf = strchr(tmp, '/');
+    keybuf = strchr(workbuf, '/');
     *keybuf++ = '\0';
 
     *key = g_strdup(keybuf);
@@ -385,10 +385,10 @@
     gchar *tmp = g_strdup(in);
 
     /* split out the host/port and key */
-    tmp += 7;
     workbuf = tmp;
+    workbuf += 7;
 
-    keybuf = strchr(tmp, '/');
+    keybuf = strchr(workbuf, '/');
     *keybuf++ = '\0';
 
     *key = g_strdup(keybuf);