Module Name:    src
Committed By:   christos
Date:           Tue Jun  4 00:08:00 UTC 2019

Modified Files:
        src/sbin/fsck_msdos: fat.c

Log Message:
We already incremented cl; fix indexing. Noticed by Xin Li @FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/fsck_msdos/fat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_msdos/fat.c
diff -u src/sbin/fsck_msdos/fat.c:1.29 src/sbin/fsck_msdos/fat.c:1.30
--- src/sbin/fsck_msdos/fat.c:1.29	Fri Jul 11 10:59:53 2014
+++ src/sbin/fsck_msdos/fat.c	Mon Jun  3 20:08:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fat.c,v 1.29 2014/07/11 14:59:53 christos Exp $	*/
+/*	$NetBSD: fat.c,v 1.30 2019/06/04 00:08:00 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fat.c,v 1.29 2014/07/11 14:59:53 christos Exp $");
+__RCSID("$NetBSD: fat.c,v 1.30 2019/06/04 00:08:00 christos Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -562,8 +562,8 @@ writefat(int fs, struct bootblock *boot,
 				break;
 			if (fat[cl].next == CLUST_FREE)
 				boot->NumFree++;
-			*p++ |= (u_char)(fat[cl + 1].next << 4);
-			*p++ = (u_char)(fat[cl + 1].next >> 4);
+			*p++ |= (u_char)(fat[cl].next << 4);
+			*p++ = (u_char)(fat[cl].next >> 4);
 			break;
 		}
 	}

Reply via email to