From: Nikolaus Rath Date: Sat, 1 Apr 2023 21:42:18 +0000 (+0100) Subject: Fix compiler warning in hello_ll.c (#760) X-Git-Tag: fuse-3.15.0~31 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2113871279d3c270c01c54c81782e982ec6e8246;p=qemu-gpiodev%2Flibfuse.git Fix compiler warning in hello_ll.c (#760) --- diff --git a/example/hello_ll.c b/example/hello_ll.c index 96afd0f..0299ffb 100644 --- a/example/hello_ll.c +++ b/example/hello_ll.c @@ -160,7 +160,7 @@ static void hello_ll_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name, assert(ino == 2); if (strcmp(name, "hello_ll_getxattr_name") == 0) { - char *buf = "hello_ll_getxattr_value"; + const char *buf = "hello_ll_getxattr_value"; fuse_reply_buf(req, buf, strlen(buf)); } else @@ -175,8 +175,10 @@ static void hello_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name, (void)flags; (void)size; assert(ino == 2); + const char* exp_val = "hello_ll_setxattr_value"; if (strcmp(name, "hello_ll_setxattr_name") == 0 && - strcmp(value, "hello_ll_setxattr_value") == 0) + strlen(exp_val) == size && + strncmp(value, exp_val, size) == 0) { fuse_reply_err(req, 0); }