Cleaned up readString
This commit is contained in:
parent
4f1a1c8b16
commit
0d48e62811
@ -297,15 +297,15 @@ std::string DataInputStream::readString()
|
|||||||
{
|
{
|
||||||
std::string s;
|
std::string s;
|
||||||
int size = readInt();
|
int size = readInt();
|
||||||
if (size == 0)
|
if (size != 0)
|
||||||
return std::string();
|
{
|
||||||
|
|
||||||
s.resize(size);
|
s.resize(size);
|
||||||
_istream->read((char*)s.c_str(), size);
|
_istream->read((char*)s.c_str(), size);
|
||||||
//if (_istream->rdstate() & _istream->failbit)
|
//if (_istream->rdstate() & _istream->failbit)
|
||||||
// throw Exception("DataInputStream::readString(): Failed to read string value.");
|
// 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;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user