From 8f1e9d254aff45d8214955445b1fce5ab5b56791 Mon Sep 17 00:00:00 2001
From: y2-binyahya <yasser2.binyahya@live.uwe.ac.uk>
Date: Sun, 9 Jul 2023 16:21:49 +0000
Subject: [PATCH] added args counter

---
 src/userprog/process.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/userprog/process.c b/src/userprog/process.c
index 9a35473..dc078d4 100644
--- a/src/userprog/process.c
+++ b/src/userprog/process.c
@@ -69,17 +69,24 @@ process_execute (const char *file_name)
     file_name=file_name_extracted; //assign the extracted filename to the original var to be passed.
     //prints out to check the args 
     
+    int number_of_args=0; // to count how many args out of 3 passed to the stack 
+
     printf("filename: %s\n", filename);
       if(args1!=NULL){
           printf("args1: %s\n", args1);
+          number_of_args+=1;
       }
       if(args2!=NULL){
           printf("args2: %s\n", args2);
+          number_of_args+=1;
       }
       if(args3!=NULL){
           printf("args3: %s\n", args3);
+          number_of_args+=1;
       }
     
+    printf("args count: %i\n", number_of_args);
+    
 
 
   if (tid == TID_ERROR)
-- 
GitLab