Commits

Mathias Panzenböck committed b09d480

even properly initialize unused fields

Comments (0)

Files changed (1)

vpkfs/src/vpkfs.cpp

 			bufvec->count        = 2;
 			bufvec->buf[0].size  = count;
 			bufvec->buf[0].mem   = buf;
+			bufvec->buf[0].fd    = -1;
 			bufvec->buf[1].size  = rest;
 			bufvec->buf[1].flags = (enum fuse_buf_flags)(FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK);
 			bufvec->buf[1].fd    = m_archives[file->index];
 			bufvec->count       = 1;
 			bufvec->buf[0].size = count;
 			bufvec->buf[0].mem  = buf;
+			bufvec->buf[0].fd   = -1;
 		}
 	}
 	else {
 		bufvec = (struct fuse_bufvec*)calloc(1, sizeof(struct fuse_bufvec));
 		if (!bufvec) return -ENOMEM;
-		bufvec->count       = 1;
+		bufvec->count        = 1;
 		bufvec->buf[0].size  = count = std::min(size, fileSize - offset);
 		bufvec->buf[0].flags = (enum fuse_buf_flags)(FUSE_BUF_IS_FD | FUSE_BUF_FD_SEEK);
 		bufvec->buf[0].fd    = m_archives[file->index];