Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/commands.c @ 471:82a27508fb85
Fix segfaults when using /buffer and /room while not connected
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 02 Oct 2005 10:57:09 +0200 |
parents | eaa2ad773192 |
children | 75442262c082 |
comparison
equal
deleted
inserted
replaced
470:eaa2ad773192 | 471:82a27508fb85 |
---|---|
637 | 637 |
638 static void do_buffer(char *arg) | 638 static void do_buffer(char *arg) |
639 { | 639 { |
640 int search_dir = 0; | 640 int search_dir = 0; |
641 | 641 |
642 if (!current_buddy) return; | |
642 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) { | 643 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) { |
643 scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer"); | 644 scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer"); |
644 return; | 645 return; |
645 } | 646 } |
646 | 647 |
952 if (!arg || (!*arg)) { | 953 if (!arg || (!*arg)) { |
953 scr_LogPrint(LPRINT_NORMAL, "Missing parameter"); | 954 scr_LogPrint(LPRINT_NORMAL, "Missing parameter"); |
954 return; | 955 return; |
955 } | 956 } |
956 | 957 |
958 if (!current_buddy) return; | |
957 bud = BUDDATA(current_buddy); | 959 bud = BUDDATA(current_buddy); |
958 | 960 |
959 if (!strncasecmp(arg, "join", 4)) { | 961 if (!strncasecmp(arg, "join", 4)) { |
960 char *roomname, *nick; | 962 char *roomname, *nick; |
961 | 963 |