From a85fd836af59f2eface84ac193772cb0e779265e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 20 Jul 2019 04:14:39 +0200 Subject: 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 --- examples/copyattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1