diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-13 00:12:07 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-13 00:12:07 +0000 |
commit | 1be0d260da62542dd27b8a6f5d367a2e79191a8d (patch) | |
tree | 9a0daac3dd5e0cd33255d5a54491d61c67898604 | |
parent | 70533795ac441b82e40b0cf4b8709994be7ac5ce (diff) |
Fixed handling of contact lists where at least the first contact is not in
any group yet. Crashing is not the right solution.
-rw-r--r-- | protocols/yahoo/libyahoo2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 57c32e2d..5b2ff44e 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -1493,13 +1493,14 @@ static void yahoo_process_buddy_list(struct yahoo_input_data *yid, newbud->id = strdup(pair->value); if (cur_group) newbud->group = strdup(cur_group); - else { + else if (yd->buddies) { struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(yd-> buddies, y_list_length(yd->buddies) - 1)->data; newbud->group = strdup(lastbud->group); - } + } else + newbud->group = strdup("Buddies"); yd->buddies = y_list_append(yd->buddies, newbud); |