X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fio%2Fmemory.cpp;h=37954cca5bea6bb95a62a5afdfc094009584ba83;hb=8a3d4f05f46bcd6dda9fc28794d4ac84d0d96f08;hp=bc14ff1fd4e832967b93f346a7fd4de29c74f552;hpb=20b368c89a98f22243a0d496037ad0c43671eea7;p=libs%2Fcore.git diff --git a/source/io/memory.cpp b/source/io/memory.cpp index bc14ff1..37954cc 100644 --- a/source/io/memory.cpp +++ b/source/io/memory.cpp @@ -66,6 +66,10 @@ unsigned Memory::do_read(char *buf, unsigned size) unsigned Memory::put(char c) { check_access(M_WRITE); + + if(pos==end) + return 0; + *pos++ = c; return 1; } @@ -112,9 +116,10 @@ SeekOffset Memory::seek(SeekOffset off, SeekType type) throw invalid_argument("Memory::seek"); if(new_posend) - throw out_of_range("Memory::seek"); + throw bad_seek(off, type); pos = new_pos; + eof_flag = false; return pos-begin; }