From 5faed9658d616e27fbcb57019916c2d9a9a72e7b Mon Sep 17 00:00:00 2001 From: y2-binyahya <yasser2.binyahya@live.uwe.ac.uk> Date: Sun, 9 Jul 2023 16:16:28 +0000 Subject: [PATCH] added if statement to avoid null values --- src/userprog/process.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/userprog/process.c b/src/userprog/process.c index 0e8736f..9a35473 100644 --- a/src/userprog/process.c +++ b/src/userprog/process.c @@ -68,13 +68,18 @@ process_execute (const char *file_name) /* team members should handle these data and prepare it for task 2 in arguments passing */ file_name=file_name_extracted; //assign the extracted filename to the original var to be passed. //prints out to check the args - + printf("filename: %s\n", filename); - - printf("args1: %s\n", args1); - printf("args2: %s\n", args2); - printf("args3: %s\n", args3); - + if(args1!=NULL){ + printf("args1: %s\n", args1); + } + if(args2!=NULL){ + printf("args2: %s\n", args2); + } + if(args3!=NULL){ + printf("args3: %s\n", args3); + } + if (tid == TID_ERROR) -- GitLab