X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAccount.cpp;h=f650330a0f87bcbb3d9c456eb03488bf3fca5d88;hb=757fd9c1ec8d263225df90ef486051712f448483;hp=11483f89c2eb39ec7a40bd2a503d3cdfe66c786f;hpb=8d45019f2b1ac74108ae4589333680158fee32d5;p=lugaru.git diff --git a/Source/Account.cpp b/Source/Account.cpp index 11483f8..f650330 100644 --- a/Source/Account.cpp +++ b/Source/Account.cpp @@ -23,6 +23,7 @@ along with Lugaru. If not, see . #include #include "MacCompatibility.h" #include "string.h" +#include using namespace std; @@ -115,7 +116,7 @@ Account* Account::loadFile(string filename) int numaccounts; int accountactive; - tfile = fopen(ConvertFileName(filename.c_str()), "rb" ); + tfile = fopen(filename.c_str(), "rb" ); if (tfile) { funpackf(tfile, "Bi", &numaccounts); @@ -185,7 +186,7 @@ Account* Account::loadFile(string filename) fclose(tfile); return get(accountactive); } else { - printf("filenotfound\n"); + perror(("Couldn't load users from " + filename).c_str()); return NULL; } } @@ -194,7 +195,7 @@ void Account::saveFile(string filename, Account* accountactive) { FILE *tfile; - tfile = fopen(ConvertFileName(filename.c_str(), "wb"), "wb" ); + tfile = fopen(filename.c_str(), "wb" ); if (tfile) { printf("writing %d accounts :\n", getNbAccounts()); fpackf(tfile, "Bi", getNbAccounts()); @@ -243,6 +244,8 @@ void Account::saveFile(string filename, Account* accountactive) } fclose(tfile); + } else { + perror(("Couldn't save users in " + filename).c_str()); } }