summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-03-14 23:18:34 +0000
committerThomas Schwinge <tschwinge@gnu.org>2006-03-14 23:18:34 +0000
commit286eb68d7ee3687ddef95b9a48674d71c82dd7a9 (patch)
treecad89c4e89c1c0e3c767c6036dcbddd9b88be50e
parentdf8b37b7a5043b45111349e5f4489db87dad31be (diff)
2006-03-15 Thomas Schwinge <tschwinge@gnu.org>
* boot.c (boot_script_exec_cmd): Fix invalid lvalues.
-rw-r--r--boot/ChangeLog4
-rw-r--r--boot/boot.c17
2 files changed, 16 insertions, 5 deletions
diff --git a/boot/ChangeLog b/boot/ChangeLog
index 968560ff..b1e3a6ad 100644
--- a/boot/ChangeLog
+++ b/boot/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-15 Thomas Schwinge <tschwinge@gnu.org>
+
+ * boot.c (boot_script_exec_cmd): Fix invalid lvalues.
+
2003-01-04 Roland McGrath <roland@frob.com>
* boot_script.c (boot_script_parse_line): Copy the file name into
diff --git a/boot/boot.c b/boot/boot.c
index 7530acf1..33e1930e 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1,6 +1,7 @@
/* Load a task using the single server, and then run it
as if we were the kernel.
- Copyright (C) 1993,94,95,96,97,98,99,2000,01,02 Free Software Foundation, Inc.
+ Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,2006
+ Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -367,11 +368,17 @@ boot_script_exec_cmd (void *hook,
str_start = ((vm_address_t) arg_pos
+ (argc + 2) * sizeof (char *) + sizeof (integer_t));
p = args + ((vm_address_t) arg_pos & (vm_page_size - 1));
- *((int *) p)++ = argc;
+ *(int *) p = argc;
+ p = (void *) p + sizeof (int);
for (i = 0; i < argc; i++)
- *((char **) p)++ = argv[i] - strings + (char *) str_start;
- *((char **) p)++ = 0;
- *((char **) p)++ = 0;
+ {
+ *(char **) p = argv[i] - strings + (char *) str_start;
+ p = (void *) p + sizeof (char *);
+ }
+ *(char **) p = 0;
+ p = (void *) p + sizeof (char *);
+ *(char **) p = 0;
+ p = (void *) p + sizeof (char *);
memcpy (p, strings, stringlen);
bzero (args, (vm_offset_t) arg_pos & (vm_page_size - 1));
vm_write (task, trunc_page ((vm_offset_t) arg_pos), (vm_address_t) args,