summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/adv.inc4
-rw-r--r--extlinux/main.c2
-rw-r--r--libinstaller/syslxmod.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/core/adv.inc b/core/adv.inc
index 2dc16339..67252619 100644
--- a/core/adv.inc
+++ b/core/adv.inc
@@ -77,8 +77,8 @@ adv_init:
mov bx,[DataSectors]
shl bx,2
mov ecx,[bsHidden]
- mov eax,[bx+SectorPtrs] ; First ADV sector
- mov edx,[bx+SectorPtrs+4] ; Second ADV sector
+ mov eax,[bx+SectorPtrs-4]; First ADV sector
+ mov edx,[bx+SectorPtrs] ; Second ADV sector
add eax,ecx
add edx,ecx
mov [ADVSec0],eax
diff --git a/extlinux/main.c b/extlinux/main.c
index dea2d198..6bf6872d 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -561,7 +561,7 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
nptrs = get_16(&patcharea->secptrcnt);
memset(wp, 0, nptrs * 4);
- while (nsect--)
+ while (--nsect) /* the first sector in bs->NextSector */
set_32(wp++, *sectp++);
/* Poke in the base directory path */
diff --git a/libinstaller/syslxmod.c b/libinstaller/syslxmod.c
index e18d8a69..be06b9a2 100644
--- a/libinstaller/syslxmod.c
+++ b/libinstaller/syslxmod.c
@@ -269,7 +269,7 @@ int syslinux_patch(const uint32_t * sectors, int nsectors,
get_16_sl(&patcharea->secptroffset));
nptrs = get_16_sl(&patcharea->secptrcnt);
- while (nsect--) {
+ while (--nsect) { /* the first sector is in bs->NextSector */
set_32_sl(wp++, *sectors++);
nptrs--;
}