Deleted Added
full compact
fat.c (92839) fat.c (102231)
1/*
2 * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank
3 * Copyright (c) 1995 Martin Husemann
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33
34#include <sys/cdefs.h>
35#ifndef lint
36__RCSID("$NetBSD: fat.c,v 1.12 2000/10/10 20:24:52 is Exp $");
37static const char rcsid[] =
1/*
2 * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank
3 * Copyright (c) 1995 Martin Husemann
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33
34#include <sys/cdefs.h>
35#ifndef lint
36__RCSID("$NetBSD: fat.c,v 1.12 2000/10/10 20:24:52 is Exp $");
37static const char rcsid[] =
38 "$FreeBSD: head/sbin/fsck_msdosfs/fat.c 92839 2002-03-20 22:57:10Z imp $";
38 "$FreeBSD: head/sbin/fsck_msdosfs/fat.c 102231 2002-08-21 18:11:48Z trhodes $";
39#endif /* not lint */
40
41#include <stdlib.h>
42#include <string.h>
43#include <ctype.h>
44#include <stdio.h>
45#include <unistd.h>
46

--- 100 unchanged lines hidden (view full) ---

147 || (boot->ClustMask == CLUST32_MASK
148 && ((buffer[3]&0x0f) != 0x0f
149 || buffer[4] != 0xff || buffer[5] != 0xff
150 || buffer[6] != 0xff || (buffer[7]&0x0f) != 0x0f))) {
151
152 /* Windows 95 OSR2 (and possibly any later) changes
153 * the FAT signature to 0xXXffff7f for FAT16 and to
154 * 0xXXffff0fffffff07 for FAT32 upon boot, to know that the
39#endif /* not lint */
40
41#include <stdlib.h>
42#include <string.h>
43#include <ctype.h>
44#include <stdio.h>
45#include <unistd.h>
46

--- 100 unchanged lines hidden (view full) ---

147 || (boot->ClustMask == CLUST32_MASK
148 && ((buffer[3]&0x0f) != 0x0f
149 || buffer[4] != 0xff || buffer[5] != 0xff
150 || buffer[6] != 0xff || (buffer[7]&0x0f) != 0x0f))) {
151
152 /* Windows 95 OSR2 (and possibly any later) changes
153 * the FAT signature to 0xXXffff7f for FAT16 and to
154 * 0xXXffff0fffffff07 for FAT32 upon boot, to know that the
155 * filesystem is dirty if it doesn't reboot cleanly.
155 * file system is dirty if it doesn't reboot cleanly.
156 * Check this special condition before errorring out.
157 */
158 if (buffer[0] == boot->Media && buffer[1] == 0xff
159 && buffer[2] == 0xff
160 && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f)
161 || (boot->ClustMask == CLUST32_MASK
162 && buffer[3] == 0x0f && buffer[4] == 0xff
163 && buffer[5] == 0xff && buffer[6] == 0xff

--- 460 unchanged lines hidden ---
156 * Check this special condition before errorring out.
157 */
158 if (buffer[0] == boot->Media && buffer[1] == 0xff
159 && buffer[2] == 0xff
160 && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f)
161 || (boot->ClustMask == CLUST32_MASK
162 && buffer[3] == 0x0f && buffer[4] == 0xff
163 && buffer[5] == 0xff && buffer[6] == 0xff

--- 460 unchanged lines hidden ---