For give my poor English, this question really confused me:
You are asked to write a C11 function to locate and print all potential trojan- horse programs found via a user’s “PATH” environment variable. The C11 function should have the prototype:
int find potential trojans(char *testpath);
If there are 3 executable programs named “ls” and 2 named “cp” that can be found via a “PATH” environment variable, then the function will print the full pathnames of all 5 programs, and return the integer 5 to indicate the number of suspicious programs found.
Does that mean: if there are EXACTLY 3 executable programs named “ls” and 2 named “cp” the function returns 5, all other situations, it returns 0 or something?
OR, if there are 1 lses, and 1 cps, it will return 2
if there are 2 lses, and 1 cps, it will return 3
if there is no lese, no cps, it return 0?