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.
edge.strict_endians
Erik Larsson 2012-08-27 21:26:57 +02:00
parent 9403b9e44f
commit 7c600754dd
1 changed files with 3 additions and 1 deletions

View File

@ -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));
}
/**