From 00305475de66824f400198e76d2e5f8edb0cb357 Mon Sep 17 00:00:00 2001 From: Alex Stratford <alexander3.stratford@live.uwe.ac.uk> Date: Mon, 2 Dec 2019 00:50:49 +0000 Subject: [PATCH] Fixes issue brought up in merge request by Josh --- userprog/populate_stack.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/userprog/populate_stack.c b/userprog/populate_stack.c index be08f79..cfb189b 100644 --- a/userprog/populate_stack.c +++ b/userprog/populate_stack.c @@ -12,15 +12,14 @@ void populate_stack(void* stackPointer, int argc, char** argv) { *stackPointer = PHYS_BASE; int i = argc; - - // this array holds reference to differences arguments in the stack - uint32_t * arr[argc]; + + uint32_t * arr[argc]; // Creates an array to hold arguments in the stack while (--i >= 0) { *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); } @@ -49,7 +48,6 @@ void populate_stack(void* stackPointer, int argc, char** argv) { } // 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; - return *stackPointer; } \ No newline at end of file -- GitLab