diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-12-17 14:18:48 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-12-17 14:18:48 +0100 |
commit | eece9692d707ccb20356ec06955f8308c4e59ca7 (patch) | |
tree | 55186434884960d25d11736c8f846876d568fa08 /src/tc-switchuser.c | |
parent | 987942a206ef0f2342bf81d5de6432c6af42b7e7 (diff) |
New upstream version 4.19upstream/4.19
Diffstat (limited to 'src/tc-switchuser.c')
-rw-r--r-- | src/tc-switchuser.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tc-switchuser.c b/src/tc-switchuser.c index 4cc5604..e5d2c25 100644 --- a/src/tc-switchuser.c +++ b/src/tc-switchuser.c @@ -19,9 +19,10 @@ static const struct HXoption options_table[] = { HXOPT_TABLEEND, }; -static int runner(int argc, const char **argv) +static int runner(int argc, char **argv) { - HX_getopt(options_table, &argc, &argv, HXOPT_USAGEONERR); + if (HX_getopt(options_table, &argc, &argv, HXOPT_USAGEONERR) != HXOPT_ERR_SUCCESS) + return EXIT_FAILURE; const char *user = user_name != NULL ? user_name : "-"; const char *group = group_name != NULL ? group_name : "-"; switch (HXproc_switch_user(user_name, group_name)) { @@ -62,10 +63,11 @@ static int runner(int argc, const char **argv) break; } } + HX_zvecfree(argv); return EXIT_SUCCESS; } -int main(int argc, const char **argv) +int main(int argc, char **argv) { int ret = runner(argc, argv); if (ret != EXIT_SUCCESS) |