diff --git a/ntfsprogs/cluster.c b/ntfsprogs/cluster.c index d22d8e41..f9cf858d 100644 --- a/ntfsprogs/cluster.c +++ b/ntfsprogs/cluster.c @@ -68,7 +68,8 @@ int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void while ((rec = find_attribute(AT_UNUSED, a_ctx))) { if (!rec->non_resident) { - ntfs_log_verbose("0x%02x skipped - attr is resident\n", a_ctx->attr->type); + ntfs_log_verbose("0x%02x skipped - attr is resident\n", + (int)le32_to_cpu(a_ctx->attr->type)); continue; } @@ -78,7 +79,8 @@ int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void goto done; } - ntfs_log_verbose("\t[0x%02X]\n", a_ctx->attr->type); + ntfs_log_verbose("\t[0x%02X]\n", + (int)le32_to_cpu(a_ctx->attr->type)); ntfs_log_verbose("\t\tVCN\tLCN\tLength\n"); for (j = 0; runs[j].length > 0; j++) { diff --git a/ntfsprogs/ntfscluster.c b/ntfsprogs/ntfscluster.c index ff16a0f2..03326449 100644 --- a/ntfsprogs/ntfscluster.c +++ b/ntfsprogs/ntfscluster.c @@ -397,7 +397,7 @@ static int dump_file(ntfs_volume *vol, ntfs_inode *ino) ctx = ntfs_attr_get_search_ctx(ino, NULL); while ((rec = find_attribute(AT_UNUSED, ctx))) { - ntfs_log_info(" 0x%02x - ", rec->type); + ntfs_log_info(" 0x%02x - ", (int)le32_to_cpu(rec->type)); if (rec->non_resident) { ntfs_log_info("non-resident\n"); runs = ntfs_mapping_pairs_decompress(vol, rec, NULL); diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index c5e9e233..869e0675 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -676,7 +676,8 @@ int utils_attr_get_name(ntfs_volume *vol, ATTR_RECORD *attr, char *buffer, int b name = NULL; namelen = attr->name_length; - if (ntfs_ucstombs((ntfschar *)((char *)attr + attr->name_offset), + if (ntfs_ucstombs((ntfschar *)((char *)attr + + le16_to_cpu(attr->name_offset)), namelen, &name, 0) < 0) { ntfs_log_error("Couldn't translate attribute name to current " "locale.\n");