From 9b18ab6c1019239a19160290775460601c569357 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 19 Jul 2010 16:37:00 -0700 Subject: [PATCH] dos: advance the pointer correctly Advance the pointer into the payload segment correctly. Signed-off-by: H. Peter Anvin --- dos/syslinux.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dos/syslinux.c b/dos/syslinux.c index c935f8e..1e08659 100755 --- a/dos/syslinux.c +++ b/dos/syslinux.c @@ -22,7 +22,7 @@ #include #include #include -//#include +#include #include "mystuff.h" #include "syslinux.h" @@ -604,6 +604,7 @@ int main(int argc, char *argv[]) int stupid = 0; int raid_mode = 0; int patch_sectors; + unsigned char *dp; dprintf("argv = %p\n", argv); for (i = 0; i <= argc; i++) @@ -770,10 +771,10 @@ int main(int argc, char *argv[]) * Overwrite the now-patched ldlinux.sys */ /* lock_device(3); -- doesn't seem to be needed */ + dp = syslinux_ldlinux; for (i = 0; i < patch_sectors; i++) { - unsigned char *p = syslinux_ldlinux; - memcpy_from_sl(sectbuf, p, SECTOR_SIZE); - p += SECTOR_SIZE; + memcpy_from_sl(sectbuf, dp, SECTOR_SIZE); + dp += SECTOR_SIZE; write_device(dev_fd, sectbuf, 1, sectors[i]); } -- 2.7.4