OSDN Git Service

Fixed setting a magic header to unreadable sectors in ntfsclone
authorJean-Pierre André <jpandre@users.sourceforge.net>
Sat, 9 Feb 2013 14:04:41 +0000 (15:04 +0100)
committerJean-Pierre André <jpandre@users.sourceforge.net>
Sat, 9 Feb 2013 14:04:41 +0000 (15:04 +0100)
The magic header of an unreadable sectors should have the size of
"BadSectoR", not the size of a pointer to it.

ntfsprogs/ntfsclone.c

index a6309f6..1ea0e39 100644 (file)
@@ -677,7 +677,7 @@ static int io_all(void *fd, void *buf, int count, int do_write)
 
 static void rescue_sector(void *fd, off_t pos, void *buff)
 {
-       const char *badsector_magic = "BadSectoR\0";
+       const char badsector_magic[] = "BadSectoR";
        struct ntfs_device *dev = fd;
 
        if (opt.restore_image) {