diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2023-04-01 22:42:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 22:42:18 +0100 |
commit | 2113871279d3c270c01c54c81782e982ec6e8246 (patch) | |
tree | 596180c8cab8d84ae17f0d9f279ea9956b21d09c | |
parent | d65686ac2ca5c930372a9d141bbe185477c935f5 (diff) | |
download | fuse-2113871279d3c270c01c54c81782e982ec6e8246.tar.gz |
Fix compiler warning in hello_ll.c (#760)
-rw-r--r-- | example/hello_ll.c | 6 |
1 files 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); } |