Fix stamp library loading issue (wasn't loading beyond 512 bytes, readsome doesn't always reach eof before not reading n

This commit is contained in:
Simon Robertshaw 2012-10-01 13:36:56 +01:00
parent c0c5717efe
commit 58763f0900

View File

@ -127,12 +127,11 @@ void Client::Initialise(std::string proxyString)
//Read stamps library
std::ifstream stampsLib;
stampsLib.open(STAMPS_DIR PATH_SEP "stamps.def", std::ios::binary);
while(true)
while(!stampsLib.eof())
{
char data[11];
memset(data, 0, 11);
if(stampsLib.readsome(data, 10)!=10)
break;
stampsLib.read(data, 10);
if(!data[0])
break;
stampIDs.push_back(data);