changeset 608:89f5672eb523

/move: really strip trailing space, and assign to no group if no group is specified
author Mikael Berthe <mikael@lilotux.net>
date Thu, 15 Dec 2005 18:42:38 +0100
parents cf722bff6579
children 85648a0f963e
files mcabber/src/commands.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/commands.c	Thu Dec 15 18:29:14 2005 +0100
+++ b/mcabber/src/commands.c	Thu Dec 15 18:42:38 2005 +0100
@@ -1019,14 +1019,14 @@
   newgroupname = g_strdup(arg);
   // Remove trailing space
   for (p = newgroupname; *p; p++) ;
-  while (p > newgroupname && *p == ' ') *p = 0;
+  while (p > newgroupname && *p == ' ') *p-- = 0;
 
   strip_arg_special_chars(newgroupname);
 
   // Call to buddy_setgroup() should be at the end, as current implementation
   // clones the buddy and deletes the old one (and thus, jid and name are
   // freed)
-  jb_updatebuddy(jid, name, newgroupname);
+  jb_updatebuddy(jid, name, *newgroupname ? newgroupname : NULL);
   scr_RosterUp();
   buddy_setgroup(bud, newgroupname);