Whamcloud - gitweb
debugfs "stat" should print unsigned values for xattrs
authorAndreas Dilger <adilger@clusterfs.com>
Wed, 21 Jun 2006 04:01:42 +0000 (00:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 21 Jun 2006 04:01:42 +0000 (00:01 -0400)
This patch changes debugfs to print unsigned chars when "stat" on an inode
finds xattrs in the inode.  Without this change, the values are printed
as signed chars, e.g. "ffffffec" instead of "ec".

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
debugfs/debugfs.c

index 25d52d7..8d93795 100644 (file)
@@ -443,9 +443,9 @@ static void dump_xattr_string(FILE *out, const char *str, int len)
 
        for (i = 0; i < len; i++)
                if (printable)
-                       fprintf(out, "%c", str[i]);
+                       fprintf(out, "%c", (unsigned char)str[i]);
                else
-                       fprintf(out, "%02x ", str[i]);
+                       fprintf(out, "%02x ", (unsigned char)str[i]);
 }
 
 static void internal_dump_inode_extra(FILE *out, const char *prefix,