Use sudo_basename() instead of doing the equivalent manually.

This commit is contained in:
Todd C. Miller
2021-02-10 15:14:08 -07:00
parent 41fa461fe1
commit 0663ffbc3f
15 changed files with 38 additions and 101 deletions

View File

@@ -37,12 +37,8 @@ main(int argc, char *argv[])
{
char *progbase = "progname_test";
if (argc > 0) {
if ((progbase = strrchr(argv[0], '/')) != NULL)
progbase++;
else
progbase = argv[0];
}
if (argc > 0)
progbase = sudo_basename(argv[0]);
initprogname(progbase);
/* Make sure getprogname() matches basename of argv[0]. */