aboutsummaryrefslogtreecommitdiffstats
path: root/dos
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-07-19 16:37:00 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-19 16:37:00 -0700
commit9b18ab6c1019239a19160290775460601c569357 (patch)
treec6d4c8537a347fb876eaf82e823f732a467454f8 /dos
parentf6d4a4415928ffca69eb0c498af777d74f4fc303 (diff)
downloadsyslinux-devel-9b18ab6c1019239a19160290775460601c569357.tar.gz
syslinux-devel-9b18ab6c1019239a19160290775460601c569357.tar.xz
syslinux-devel-9b18ab6c1019239a19160290775460601c569357.zip
dos: advance the pointer correctly
Advance the pointer into the payload segment correctly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'dos')
-rwxr-xr-xdos/syslinux.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/dos/syslinux.c b/dos/syslinux.c
index c935f8e8..1e086596 100755
--- a/dos/syslinux.c
+++ b/dos/syslinux.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-//#include <stdarg.h>
+#include <stdarg.h>
#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]);
}