summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2019-07-20 04:14:39 +0200
committerMike Frysinger <vapier@gentoo.org>2022-11-12 21:33:59 +0700
commita85fd836af59f2eface84ac193772cb0e779265e (patch)
treeccb9ebd3714f0867c1e6f2aa87dfb2e8faf6202f
parent0345b9aaa61121992bef18fa89578f58950b9f79 (diff)
downloadattr-a85fd836af59f2eface84ac193772cb0e779265e.tar.gz
examples: Check "user." as a prefix not as the entire string
The code was not matching any intended attribute as it was checking for the entire string. Signed-off-by: Guillem Jover <guillem@hadrons.org>
-rw-r--r--examples/copyattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/copyattr.c b/examples/copyattr.c
index 0f6928e..e3ce57b 100644
--- a/examples/copyattr.c
+++ b/examples/copyattr.c
@@ -94,7 +94,7 @@ struct error_context ctx = { error, quote, quote_free };
*/
static int is_user_attr(const char *name, struct error_context *ctx)
{
- return strcmp(name, "user.") == 0;
+ return strncmp(name, "user.", 5) == 0;
}
int