genl: remove unused code

remove unused basename logic, avoid dereference of possibly NULL variable
This commit is contained in:
Dan McGee 2011-08-31 12:15:22 -07:00 committed by Stephen Hemminger
parent 1313ceb4d6
commit 1b129bf2fe

View File

@ -109,14 +109,6 @@ static void usage(void)
int main(int argc, char **argv)
{
char *basename;
basename = strrchr(argv[0], '/');
if (basename == NULL)
basename = argv[0];
else
basename++;
while (argc > 1) {
if (argv[1][0] != '-')
break;
@ -144,8 +136,9 @@ int main(int argc, char **argv)
int ret;
struct genl_util *a = NULL;
a = get_genl_kind(argv[1]);
if (NULL == a) {
if (!a) {
fprintf(stderr,"bad genl %s\n", argv[1]);
exit(-1);
}
ret = a->parse_genlopt(a, argc-1, argv+1);