Fix read offset check for inmemory driver

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
Ahmet Alp Balkan 2014-11-25 21:43:12 -08:00
parent 59c399cb25
commit c5bb224bf9

View file

@ -67,7 +67,7 @@ func (d *Driver) ReadStream(path string, offset uint64) (io.ReadCloser, error) {
contents, err := d.GetContent(path) contents, err := d.GetContent(path)
if err != nil { if err != nil {
return nil, err return nil, err
} else if len(contents) < int(offset) { } else if len(contents) <= int(offset) {
return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset} return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
} }