summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2014-06-14 12:33:07 +0000
committertobias <tobias@openbsd.org>2014-06-14 12:33:07 +0000
commit6338317a76394901b07060f96c85cca24246fe57 (patch)
tree044c46b12cb71204f5037444aa22091f539ed7aa
parentAdd more bounded attributes to the buffer and md5/sha headers in libssl (diff)
downloadwireguard-openbsd-6338317a76394901b07060f96c85cca24246fe57.tar.xz
wireguard-openbsd-6338317a76394901b07060f96c85cca24246fe57.zip
Fix regression of 1.20 by properly incrementing pointer.
-rw-r--r--sbin/fsck_msdos/fat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c
index f10bf35da00..701e7cc1efd 100644
--- a/sbin/fsck_msdos/fat.c
+++ b/sbin/fsck_msdos/fat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fat.c,v 1.20 2014/06/10 23:03:48 tobias Exp $ */
+/* $OpenBSD: fat.c,v 1.21 2014/06/14 12:33:07 tobias Exp $ */
/* $NetBSD: fat.c,v 1.8 1997/10/17 11:19:53 ws Exp $ */
/*
@@ -472,13 +472,13 @@ writefat(int fs, struct bootblock *boot, struct fatEntry *fat)
if (fat[cl].next == CLUST_FREE)
boot->NumFree++;
*p++ = (u_char)fat[cl].next;
- *p++ = (u_char)((fat[cl].next >> 8) & 0xf);
+ *p = (u_char)((fat[cl].next >> 8) & 0xf);
cl++;
if (cl >= boot->NumClusters)
break;
if (fat[cl].next == CLUST_FREE)
boot->NumFree++;
- *p |= (u_char)(fat[cl].next << 4);
+ *p++ |= (u_char)(fat[cl].next << 4);
*p++ = (u_char)(fat[cl].next >> 4);
break;
}