From: Andreas Dilger Date: Wed, 21 Jun 2006 04:01:42 +0000 (-0400) Subject: debugfs "stat" should print unsigned values for xattrs X-Git-Tag: E2FSPROGS-1_40-WIP-1114~80 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d047e073e74598ad87ee59ff309c98bbfcd8d80f;p=tools%2Fe2fsprogs.git debugfs "stat" should print unsigned values for xattrs 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 --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 25d52d7..8d93795 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -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,