summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2017-04-02 12:12:01 -0700
committerGitHub <noreply@github.com>2017-04-02 12:12:01 -0700
commit85420e91be287ac9bb5ef2f1ae5e1b34131cc0b1 (patch)
tree9903d62a043d594adcc91ee352bdc5d224effba3
parenteee2186b7ef2c3020a75ccfacde4d2b348b12bcd (diff)
parent2c46212c6032f746e3c889b4b3d458122ccaf3b6 (diff)
downloadxattr-85420e91be287ac9bb5ef2f1ae5e1b34131cc0b1.tar.gz
Merge pull request #57 from jmgurney/master
add fix for issue w/ lsattr and long attrs..
-rw-r--r--xattr/lib_build.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/xattr/lib_build.py b/xattr/lib_build.py
index 0c13ef3..a687cea 100644
--- a/xattr/lib_build.py
+++ b/xattr/lib_build.py
@@ -52,15 +52,13 @@ C_SRC = """
#define XATTR_REPLACE 0x2
/* Converts a freebsd format attribute list into a NULL terminated list.
- * While the man page on extattr_list_file says it is NULL terminated,
- * it is actually the first byte that is the length of the
- * following attribute.
+ * The first byte is the length of the following attribute.
*/
static void convert_bsd_list(char *namebuf, size_t size)
{
size_t offset = 0;
while(offset < size) {
- int length = (int) namebuf[offset];
+ int length = (int) (unsigned char)namebuf[offset];
memmove(namebuf+offset, namebuf+offset+1, length);
namebuf[offset+length] = '\\0';
offset += length+1;