From 7c600754ddd726fc138846f83a740a0785bde72e Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Mon, 27 Aug 2012 21:26:57 +0200 Subject: [PATCH] ntfsinfo.c: Fix printing all the flags in hex in 'ntfs_dump_flags'. The variable 'flags' was modified along the way and did not contain the original flags at the end as assumed by the last printout. Fixed by storing the original state of the flags in a temporary const variable. --- ntfsprogs/ntfsinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsinfo.c b/ntfsprogs/ntfsinfo.c index e81f4985..6a924955 100644 --- a/ntfsprogs/ntfsinfo.c +++ b/ntfsprogs/ntfsinfo.c @@ -508,6 +508,8 @@ static void ntfs_dump_volume(ntfs_volume *vol) */ static void ntfs_dump_flags(const char *indent, ATTR_TYPES type, le32 flags) { + const le32 original_flags = flags; + printf("%sFile attributes:\t", indent); if (flags & FILE_ATTR_READONLY) { printf(" READONLY"); @@ -580,7 +582,7 @@ static void ntfs_dump_flags(const char *indent, ATTR_TYPES type, le32 flags) if (flags) printf(" UNKNOWN: 0x%08x", (unsigned int)le32_to_cpu(flags)); /* Print all the flags in hex. */ - printf(" (0x%08x)\n", (unsigned)le32_to_cpu(flags)); + printf(" (0x%08x)\n", (unsigned)le32_to_cpu(original_flags)); } /**