diff options
author | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-06-30 20:45:43 +0000 |
---|---|---|
committer | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2005-06-30 20:45:43 +0000 |
commit | aaff5572f054045ecd4dd94ccdc2caac71132ad4 (patch) | |
tree | b67e8b6436807072893357b55c12e01aacdac591 /src/resources/buddylist.cpp | |
parent | 5cd5f1dda32bdd812abbb7f4a72042575f153d4b (diff) | |
download | mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.gz mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.bz2 mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.tar.xz mana-aaff5572f054045ecd4dd94ccdc2caac71132ad4.zip |
Improved buddylist, added talk
Diffstat (limited to 'src/resources/buddylist.cpp')
-rw-r--r-- | src/resources/buddylist.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp index 9772ff19..9f11b5f7 100644 --- a/src/resources/buddylist.cpp +++ b/src/resources/buddylist.cpp @@ -42,7 +42,7 @@ BuddyList::~BuddyList() void BuddyList::loadFile(void) { - char buddy[LEN_USERNAME]; + char *buddy; // Open file std::ifstream inputStream(filename->c_str(), std::ios::in); @@ -52,8 +52,11 @@ void BuddyList::loadFile(void) } do { + buddy = (char *) calloc(LEN_USERNAME, sizeof(char)); inputStream.getline(buddy, LEN_USERNAME); - buddylist.push_back(buddy); + // Ugly ? + if(strcmp(buddy,"") != 0) buddylist.push_back(buddy); + free(buddy); } while(!inputStream.eof()); // Read buddy and close file |