From 664af060ac9ea83b565fbb817bb63d67d83843ef Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 1 Jun 2012 14:07:42 +1000 Subject: [PATCH] lib/replace: We cannot use strchr_m in lib/replace In any case, it is always safe to search for . even in a multibyte string. Andrew Bartlett --- lib/replace/xattr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/replace/xattr.c b/lib/replace/xattr.c index e3e0768d9c8..192784f344d 100644 --- a/lib/replace/xattr.c +++ b/lib/replace/xattr.c @@ -55,7 +55,7 @@ ssize_t rep_getxattr (const char *path, const char *name, void *value, size_t si ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; /* * The BSD implementation has a nasty habit of silently truncating * the returned value to the size of the buffer, so we have to check @@ -111,7 +111,7 @@ ssize_t rep_fgetxattr (int filedes, const char *name, void *value, size_t size) ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; if((retval=extattr_get_fd(filedes, attrnamespace, attrname, NULL, 0)) >= 0) { if(retval > size) { @@ -385,7 +385,7 @@ int rep_removexattr (const char *path, const char *name) char *s; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; return extattr_delete_file(path, attrnamespace, attrname); #elif defined(HAVE_ATTR_REMOVE) @@ -424,7 +424,7 @@ int rep_fremovexattr (int filedes, const char *name) char *s; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; return extattr_delete_fd(filedes, attrnamespace, attrname); #elif defined(HAVE_ATTR_REMOVEF) @@ -464,7 +464,7 @@ int rep_setxattr (const char *path, const char *name, const void *value, size_t int retval = 0; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; if (flags) { /* Check attribute existence */ retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); @@ -529,7 +529,7 @@ int rep_fsetxattr (int filedes, const char *name, const void *value, size_t size int retval = 0; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; - const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + const char *attrname = ((s=strchr(name, '.')) == NULL) ? name : s + 1; if (flags) { /* Check attribute existence */ retval = extattr_get_fd(filedes, attrnamespace, attrname, NULL, 0);