Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 878 vs 879 for /trunk/Source Code/Core/ByteBuffer.cpp

Diff revisions: vs.
  @@ -64,7 +64,7 @@
64 64
65 65
66 66 bool ByteBuffer::dumpToFile(const stringImpl& fileName) {
67 - if (_storage.back() != BUFFER_FORMAT_VERSION) {
67 + if (!_storage.empty() && _storage.back() != BUFFER_FORMAT_VERSION) {
68 68 append(BUFFER_FORMAT_VERSION);
69 69 }
70 70
  @@ -72,6 +72,7 @@
72 72 }
73 73
74 74 bool ByteBuffer::loadFromFile(const stringImpl& fileName) {
75 + clear();
75 76 if (readFile(fileName, _storage, FileType::BINARY)) {
76 77 return _storage.back() == BUFFER_FORMAT_VERSION;
77 78 }