Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/commands.c @ 1992:5dc408aacb14
Accept cmd_del(NULL)
It was probably working already, but an explicit check is safer...
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 27 Mar 2011 20:30:35 +0200 |
parents | dd65a18dc480 |
children | d4273346d52d |
comparison
equal
deleted
inserted
replaced
1991:0450147afa05 | 1992:5dc408aacb14 |
---|---|
105 #include "modules.h" | 105 #include "modules.h" |
106 | 106 |
107 gpointer cmd_del(gpointer id) | 107 gpointer cmd_del(gpointer id) |
108 { | 108 { |
109 GSList *sl_cmd; | 109 GSList *sl_cmd; |
110 if (!id) return NULL; | |
110 for (sl_cmd = Commands; sl_cmd; sl_cmd = sl_cmd->next) | 111 for (sl_cmd = Commands; sl_cmd; sl_cmd = sl_cmd->next) |
111 if (sl_cmd -> data == id) { | 112 if (sl_cmd -> data == id) { |
112 cmd *command = (cmd *) sl_cmd->data; | 113 cmd *command = (cmd *) sl_cmd->data; |
113 gpointer userdata = command->userdata; | 114 gpointer userdata = command->userdata; |
114 Commands = g_slist_delete_link(Commands, sl_cmd); | 115 Commands = g_slist_delete_link(Commands, sl_cmd); |