summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2019-06-04 00:08:00 +0000
committerchristos <christos@NetBSD.org>2019-06-04 00:08:00 +0000
commit0551c5a715070aa28059371bd85dbdfe81651282 (patch)
tree2c431db25ace9b4454c38bd4df1607feb5e697b3 /sbin
parentfbfda416e17f681d4c9da00f46cf7df2c405033c (diff)
We already incremented cl; fix indexing. Noticed by Xin Li @FreeBSD.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_msdos/fat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c
index dd07179cccf..c9de8be786f 100644
--- a/sbin/fsck_msdos/fat.c
+++ b/sbin/fsck_msdos/fat.c
@@ -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, 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;
}
}