buffer.c: correct return value when buf is NULL
authorZhiqiang Liu <liuzhiqiang26@huawei.com>
Wed, 11 Nov 2020 02:00:23 +0000 (10:00 +0800)
committerNikolaus Rath <Nikolaus@rath.org>
Wed, 11 Nov 2020 09:32:56 +0000 (09:32 +0000)
In commit d614415a ("buffer.c: check whether buf is
NULL in fuse_bufvec_advance func"), if fuse_bufvec_current
func returns NULL, it returns 1 directly. Actually,
we should return 0 when buf is NULL.

Fixes: d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func")
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Haotian Li <lihaotian9@huawei.com>
lib/buffer.c

index ba07b2651b32e856b5cacb6e54e02f6ce3223aa8..757807a177b7065df4539768e0ee76e3c16b6ec3 100644 (file)
@@ -267,7 +267,7 @@ static int fuse_bufvec_advance(struct fuse_bufvec *bufv, size_t len)
        const struct fuse_buf *buf = fuse_bufvec_current(bufv);
 
        if (!buf)
-               return 1;
+               return 0;
 
        bufv->off += len;
        assert(bufv->off <= buf->size);