comparison src/list.c @ 2586:0f5390176949

[gaim-migrate @ 2599] try to do things more safely. dialogs.c is really what should be changed though. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 23 Oct 2001 08:22:48 +0000
parents 20418e5702eb
children 2dd86a1af92b
comparison
equal deleted inserted replaced
2585:4424c670021d 2586:0f5390176949
104 { 104 {
105 struct buddy *b; 105 struct buddy *b;
106 struct group *g; 106 struct group *g;
107 char *good; 107 char *good;
108 108
109 if (!g_slist_find(connections, gc))
110 return NULL;
111
109 if ((b = find_buddy(gc, buddy)) != NULL) 112 if ((b = find_buddy(gc, buddy)) != NULL)
110 return b; 113 return b;
111 114
112 g = find_group(gc, group); 115 g = find_group(gc, group);
113 116
143 struct group *add_group(struct gaim_connection *gc, char *group) 146 struct group *add_group(struct gaim_connection *gc, char *group)
144 { 147 {
145 struct group *g = find_group(gc, group); 148 struct group *g = find_group(gc, group);
146 if (g) 149 if (g)
147 return g; 150 return g;
151 if (!g_slist_find(connections, gc))
152 return NULL;
148 g = (struct group *)g_new0(struct group, 1); 153 g = (struct group *)g_new0(struct group, 1);
149 if (!g) 154 if (!g)
150 return NULL; 155 return NULL;
151 156
152 g->gc = gc; 157 g->gc = gc;
168 struct gaim_connection *z; 173 struct gaim_connection *z;
169 char *grpname = g_malloc(strlen(group) + 1); 174 char *grpname = g_malloc(strlen(group) + 1);
170 175
171 strcpy(grpname, normalize (group)); 176 strcpy(grpname, normalize (group));
172 if (gc) { 177 if (gc) {
178 if (!g_slist_find(connections, gc))
179 return NULL;
173 grp = gc->groups; 180 grp = gc->groups;
174 while (grp) { 181 while (grp) {
175 g = (struct group *)grp->data; 182 g = (struct group *)grp->data;
176 if (!g_strcasecmp(normalize (g->name), grpname)) { 183 if (!g_strcasecmp(normalize (g->name), grpname)) {
177 g_free(grpname); 184 g_free(grpname);
276 GSList *mem; 283 GSList *mem;
277 char *whoname; 284 char *whoname;
278 char *(*norm)(const char *); 285 char *(*norm)(const char *);
279 286
280 if (gc) { 287 if (gc) {
288 if (!g_slist_find(connections, gc))
289 return NULL;
281 if (gc->prpl->normalize) 290 if (gc->prpl->normalize)
282 norm = gc->prpl->normalize; 291 norm = gc->prpl->normalize;
283 else 292 else
284 norm = normalize; 293 norm = normalize;
285 whoname = g_strdup((*norm)(who)); 294 whoname = g_strdup((*norm)(who));