From 2113871279d3c270c01c54c81782e982ec6e8246 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sat, 1 Apr 2023 22:42:18 +0100 Subject: Fix compiler warning in hello_ll.c (#760) --- example/hello_ll.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- cgit v1.2.1