From d650fb065b5b313247872a894482d416a2a304e7 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 6 Feb 2003 15:20:56 +0000 Subject: [PATCH] Fix stupid bug in ntfs_mapping_pairs_build() (thanks to Szaka!) and a simillar bug in ntfs_get_size_for_mapping_pairs(). (Logical change 1.113) --- libntfs/runlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libntfs/runlist.c b/libntfs/runlist.c index bfd01a5a..81ac0b72 100644 --- a/libntfs/runlist.c +++ b/libntfs/runlist.c @@ -1,7 +1,7 @@ /* * runlist.c - Run list handling code. Part of the Linux-NTFS project. * - * Copyright (c) 2002 Anton Altaparmakov + * Copyright (c) 2002-2003 Anton Altaparmakov * Copyright (c) 2002 Richard Russon * * This program/include file is free software; you can redistribute it and/or @@ -1160,7 +1160,7 @@ int ntfs_get_size_for_mapping_pairs(const ntfs_volume *vol, return 0; /* Always need the termining zero byte. */ rls = 1; - for (prev_lcn = i = 0; rl[i].length; prev_lcn = rl[++i].lcn) { + for (prev_lcn = i = 0; rl[i].length; prev_lcn = rl[i++].lcn) { if (rl[i].length < 0 || rl[i].lcn < LCN_HOLE) goto err_out; /* Header byte + length. */ @@ -1269,7 +1269,7 @@ int ntfs_mapping_pairs_build(const ntfs_volume *vol, s8 *dst, * ntfs_write_significant_bytes(). */ dst_max = dst + dst_len - 1; - for (prev_lcn = i = 0; rl[i].length; prev_lcn = rl[++i].lcn) { + for (prev_lcn = i = 0; rl[i].length; prev_lcn = rl[i++].lcn) { if (rl[i].length < 0 || rl[i].lcn < LCN_HOLE) goto err_out; /* Write length. */