aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/memfile.c')
-rw-r--r--src/nvim/memfile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index ae35427666..f30eb38e99 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -560,9 +560,7 @@ static int mf_read(memfile_T *mfp, bhdr_T *hp)
/// - Write error in swap file.
static int mf_write(memfile_T *mfp, bhdr_T *hp)
{
- off_T offset; // offset in the file
bhdr_T *hp2;
- unsigned page_size; // number of bytes in a page
unsigned page_count; // number of pages written
if (mfp->mf_fd < 0) { // there is no file, can't write
@@ -575,7 +573,7 @@ static int mf_write(memfile_T *mfp, bhdr_T *hp)
}
}
- page_size = mfp->mf_page_size;
+ unsigned page_size = mfp->mf_page_size; // number of bytes in a page
/// We don't want gaps in the file. Write the blocks in front of *hp
/// to extend the file.
@@ -591,7 +589,7 @@ static int mf_write(memfile_T *mfp, bhdr_T *hp)
}
// TODO(elmart): Check (page_size * nr) within off_T bounds.
- offset = (off_T)(page_size * nr);
+ off_T offset = (off_T)(page_size * nr); // offset in the file
if (vim_lseek(mfp->mf_fd, offset, SEEK_SET) != offset) {
PERROR(_("E296: Seek error in swap file write"));
return FAIL;