Skip to content

Commit 02b11e7

Browse files
author
Jose Sebastian Battig
committed
B-0 fixed seek method. Bad interpretation of seek_end mode. it should seek from one byte more than number of bytes written. seek_end with offset zero should put pointer exactly at the end ready to receive more data
1 parent ec8657d commit 02b11e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongoc/mongoc-gridfs-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ mongoc_gridfs_file_seek (mongoc_gridfs_file_t *file,
709709
offset = file->pos + delta;
710710
break;
711711
case SEEK_END:
712-
offset = (file->length - 1) + delta;
712+
offset = file->length + delta;
713713
break;
714714
default:
715715
errno = EINVAL;

0 commit comments

Comments
 (0)