From c0a5e11eef53f166ba638ac561a4205905c9922b Mon Sep 17 00:00:00 2001 From: emma Date: Thu, 25 Jul 2024 21:28:42 -0600 Subject: [PATCH] mm(1): revert changes to program_name --- src/mm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mm.c b/src/mm.c index 63cc3ff..8779e8e 100644 --- a/src/mm.c +++ b/src/mm.c @@ -125,7 +125,6 @@ int main(int argc, char *argv[]) { size_t j; size_t k; /* loop index but also unbuffer status */ int retval; - program_name = (argv[0] == NULL ? program_name : argv[0]); /* Initializes the files structs with their default values, standard * input and standard output. If an input or an output is specified @@ -150,6 +149,8 @@ int main(int argc, char *argv[]) { k = 0; + if (argc > 0) { program_name = argv[0]; } + if (argc > 1) { while ((c = getopt(argc, argv, "aehi:no:u")) != -1) { switch (c){