From 05bf546cb00df6595642a49cd8684a85c8d5866a Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Tue, 4 Nov 2003 13:04:07 +0000 Subject: [PATCH] Now file_size is signed. (Logical change 1.223) --- include/logfile.h | 2 +- ntfsprogs/dumplog.c | 4 ++-- ntfsprogs/ntfsdump_logfile.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/logfile.h b/include/logfile.h index 34a62fd8..e3d5f074 100644 --- a/include/logfile.h +++ b/include/logfile.h @@ -110,7 +110,7 @@ typedef struct { have to be <= 510. Also, the offset to the client array + (log_clients * 0xa0) have to be <= SystemPageSize. = 0x30 */ - u64 file_size; /* Byte size of the log file. If the + s64 file_size; /* Byte size of the log file. If the restart_offset + the offset of the file_size are > 510 then corruption has occured. This is the very first check when starting with diff --git a/ntfsprogs/dumplog.c b/ntfsprogs/dumplog.c index a1fa27ca..96558a5b 100644 --- a/ntfsprogs/dumplog.c +++ b/ntfsprogs/dumplog.c @@ -173,8 +173,8 @@ pass_loc: le16_to_cpu(rr->restart_area_length)); printf("ClientArrayOffset = 0x%x\n", le16_to_cpu(rr->client_array_offset)); - printf("FileSize = %Lu (0x%Lx)\n", le64_to_cpu(rr->file_size), - le64_to_cpu(rr->file_size)); + printf("FileSize = %Lu (0x%Lx)\n", sle64_to_cpu(rr->file_size), + sle64_to_cpu(rr->file_size)); printf("LastLsnDataLength = 0x%x\n", le32_to_cpu(rr->last_lsn_data_length)); printf("RecordLength = 0x%x\n", le16_to_cpu(rr->record_length)); diff --git a/ntfsprogs/ntfsdump_logfile.c b/ntfsprogs/ntfsdump_logfile.c index af876e35..a631e46d 100644 --- a/ntfsprogs/ntfsdump_logfile.c +++ b/ntfsprogs/ntfsdump_logfile.c @@ -1,7 +1,7 @@ /** * NtfsDump_LogFile - Part of the Linux-NTFS project. * - * Copyright (c) 2000-2002 Anton Altaparmakov + * Copyright (c) 2000-2003 Anton Altaparmakov * * This utility will interpret the contents of the journal ($LogFile) of an * NTFS partition and display the results on stdout. Errors will be output to @@ -223,9 +223,9 @@ pass_loc: le16_to_cpu(rr->restart_area_length)); printf("ClientArrayOffset = 0x%x\n", le16_to_cpu(rr->client_array_offset)); - printf("FileSize = %Lu (0x%Lx)\n", le64_to_cpu(rr->file_size), - le64_to_cpu(rr->file_size)); - if (le64_to_cpu(rr->file_size) != l) + printf("FileSize = %Lu (0x%Lx)\n", sle64_to_cpu(rr->file_size), + sle64_to_cpu(rr->file_size)); + if (sle64_to_cpu(rr->file_size) != l) puts("$LogFile restart area indicates a log file size" "different from the actual size!"); printf("LastLsnDataLength = 0x%x\n",