]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Account.cpp
some more cleans thanks to cppcheck
[lugaru.git] / Source / Account.cpp
index d601c4ac64a4ded51ea548d0c95a611fd7120cc1..56aaf9c33a723f516daaf403e7d73c036031a894 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010 - MCMic
+Copyright (C) 2010 - Côme <MCMic> BERNIGAUD
 
 This file is part of Lugaru.
 
@@ -54,7 +54,8 @@ Account* Account::add(string name) {
 }
 
 Account* Account::get(int i) {
-       if(i<accounts.size()) {
+       
+       if((i>=0)&&(i<accounts.size())) {
                return accounts[i];
        } else
                return NULL;
@@ -166,7 +167,6 @@ Account* Account::loadFile(string filename) {
 
 void Account::saveFile(string filename, Account* accountactive) {
        FILE *tfile;
-       int numaccounts;
        int j;
        
        tfile=fopen(ConvertFileName(filename.c_str(), "wb"), "wb" );