[syslinux:master] dos: advance the pointer correctly
syslinux-bot for H. Peter Anvin
hpa at linux.intel.com
Mon Jul 19 21:24:13 PDT 2010
Commit-ID: 9b18ab6c1019239a19160290775460601c569357
Gitweb: http://syslinux.zytor.com/commit/9b18ab6c1019239a19160290775460601c569357
Author: H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Mon, 19 Jul 2010 16:37:00 -0700
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 19 Jul 2010 16:37:00 -0700
dos: advance the pointer correctly
Advance the pointer into the payload segment correctly.
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
dos/syslinux.c | 9 +++++----
1 files 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 <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]);
}
More information about the Syslinux-commits
mailing list