diff options
| author | ljfa <ljfa-ag@web.de> | 2015-08-13 14:50:33 +0200 |
|---|---|---|
| committer | ljfa <ljfa-ag@web.de> | 2015-08-13 14:54:34 +0200 |
| commit | 5e057e152e214d7c92a03192e6c3a235df5961ea (patch) | |
| tree | 197ecb30d7d93a43e3c1850620052697d500f7f6 /src/io | |
| parent | aac94b91ad83ad8f7832976e6da55d15de6e54e1 (diff) | |
| download | Project-Tick-5e057e152e214d7c92a03192e6c3a235df5961ea.tar.gz Project-Tick-5e057e152e214d7c92a03192e6c3a235df5961ea.zip | |
Set failbit on ostream in case of error
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/stream_writer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io/stream_writer.cpp b/src/io/stream_writer.cpp index ee8b0ee2b6..036c5d40ac 100644 --- a/src/io/stream_writer.cpp +++ b/src/io/stream_writer.cpp @@ -41,6 +41,7 @@ void stream_writer::write_string(const std::string& str) { if(str.size() > max_string_len) { + os.setstate(std::ios::failbit); std::ostringstream sstr; sstr << "String is too long for NBT (" << str.size() << " > " << max_string_len << ")"; throw std::length_error(sstr.str()); |
