projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
959bb34
)
Fix seeking of Slice
author
Mikko Rasa
<tdb@tdb.fi>
Sat, 13 Apr 2013 16:09:52 +0000
(19:09 +0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Sat, 13 Apr 2013 16:09:52 +0000
(19:09 +0300)
source/io/slice.cpp
patch
|
blob
|
history
diff --git
a/source/io/slice.cpp
b/source/io/slice.cpp
index 423c1a6c8cae85e73c2f6e15e9733786b31d700e..904f748668e472257ae383dd93330cc8fc3d4299 100644
(file)
--- a/
source/io/slice.cpp
+++ b/
source/io/slice.cpp
@@
-90,12
+90,13
@@
int Slice::get()
SeekOffset Slice::seek(SeekOffset off, SeekType type)
{
- if(type==S_BEG)
- off += start_offset;
- else if(type==S_CUR)
+ off += start_offset;
+ if(type==S_CUR)
off += position;
else if(type==S_END)
- off += start_offset+length;
+ off += length;
+ else if(type!=S_BEG)
+ throw invalid_argument("Slice::seek");
if(off<start_offset || off>start_offset+length)
throw bad_seek(off, type);