From 40ae5495bdc601df481a896b3e6a88d36d436a5d Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Mon, 15 Apr 2019 03:08:44 +0200
Subject: [PATCH attr 5/8] 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>
---
 examples/copyattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/copyattr.c b/examples/copyattr.c
index f8acb73..5ffe564 100644
--- a/examples/copyattr.c
+++ b/examples/copyattr.c
@@ -88,7 +88,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
-- 
2.22.0.657.g960e92d24f

