From 51a1c26a18f98b8579ec000d9a082c4b1c30b495 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 4 Jun 2019 07:02:20 +0000 Subject: [PATCH] Don't increment cl after increment. MFC after: 3 days --- sbin/fsck_msdosfs/fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index 7ea027443d01..6ea52181939c 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -645,8 +645,8 @@ writefat(int fs, struct bootblock *boot, struct fatEntry *fat, int correct_fat) 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; } }