aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse_lowlevel.c
diff options
context:
space:
mode:
authorGravatar Angelo G. Del Regno <kholk11@gmail.com>2017-06-04 11:02:07 +0200
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-06-05 11:25:14 -0400
commitb2aaaaf40cdbc887d50cc0b504e25e199fcb3b13 (patch)
tree49aae082b82201fa99d5e8d280af60c5fab402f0 /lib/fuse_lowlevel.c
parentf13526ed66d76bb36dc8a145d803f4913d772a2c (diff)
Fix comparison of integers of different signs
Some variables of different size and sign were getting compared without any safe casting. The build system also throws warnings at this and, being this library used for filesystems, it's really important to ensure stability.
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r--lib/fuse_lowlevel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 1ece58c..c3724a6 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -2399,12 +2399,12 @@ static const char *opname(enum fuse_opcode opcode)
static int fuse_ll_copy_from_pipe(struct fuse_bufvec *dst,
struct fuse_bufvec *src)
{
- int res = fuse_buf_copy(dst, src, 0);
+ ssize_t res = fuse_buf_copy(dst, src, 0);
if (res < 0) {
fprintf(stderr, "fuse: copy from pipe: %s\n", strerror(-res));
return res;
}
- if (res < fuse_buf_size(dst)) {
+ if ((size_t)res < fuse_buf_size(dst)) {
fprintf(stderr, "fuse: copy from pipe: short read\n");
return -1;
}
@@ -2940,7 +2940,7 @@ retry:
goto out_free;
}
- if (ret == bufsize) {
+ if ((size_t)ret == bufsize) {
free(buf);
bufsize *= 4;
goto retry;