Cleaned up readString

This commit is contained in:
Robert Osfield 2007-02-08 15:01:27 +00:00
parent 4f1a1c8b16
commit 0d48e62811

View File

@ -297,16 +297,16 @@ std::string DataInputStream::readString()
{
std::string s;
int size = readInt();
if (size == 0)
return std::string();
s.resize(size);
_istream->read((char*)s.c_str(), size);
//if (_istream->rdstate() & _istream->failbit)
// throw Exception("DataInputStream::readString(): Failed to read string value.");
if (size != 0)
{
s.resize(size);
_istream->read((char*)s.c_str(), size);
//if (_istream->rdstate() & _istream->failbit)
// throw Exception("DataInputStream::readString(): Failed to read string value.");
if (_verboseOutput) std::cout<<"read/writeString() ["<<s<<"]"<<std::endl;
if (_verboseOutput) std::cout<<"read/writeString() ["<<s<<"]"<<std::endl;
}
return s;
}