Skip to content
Snippets Groups Projects
Commit 00305475 authored by a2-stratford's avatar a2-stratford
Browse files

Fixes issue brought up in merge request by Josh

parent 5eef1694
No related branches found
No related tags found
1 merge request!5Alex/6 implement populate stack process
...@@ -13,14 +13,13 @@ void populate_stack(void* stackPointer, int argc, char** argv) { ...@@ -13,14 +13,13 @@ void populate_stack(void* stackPointer, int argc, char** argv) {
*stackPointer = PHYS_BASE; *stackPointer = PHYS_BASE;
int i = argc; int i = argc;
// this array holds reference to differences arguments in the stack uint32_t * arr[argc]; // Creates an array to hold arguments in the stack
uint32_t * arr[argc];
while (--i >= 0) while (--i >= 0)
{ {
*stackPointer = *stackPointer - (strlen(argv[i]) + 1) * sizeof(char); *stackPointer = *stackPointer - (strlen(argv[i]) + 1) * sizeof(char);
arr[i] = (uint32_t *)*stackPointer; arr[i] = (uint32_t *)*stackPointer; // Assigns the current reference of the stackpointer to the array
memcpy(*stackPointer, argv[i], strlen(argv[i]) + 1); memcpy(*stackPointer, argv[i], strlen(argv[i]) + 1);
} }
...@@ -49,7 +48,6 @@ void populate_stack(void* stackPointer, int argc, char** argv) { ...@@ -49,7 +48,6 @@ void populate_stack(void* stackPointer, int argc, char** argv) {
} }
// Adds the move value to the stack pointer // Adds the move value to the stack pointer
int move_stack_pointer(void* stackPointer, int moveValue) { static void move_stack_pointer(void** stackPointer, int moveValue) {
*stackPointer = *stackPointer + moveValue; *stackPointer = *stackPointer + moveValue;
return *stackPointer;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment