genl: remove unused code
remove unused basename logic, avoid dereference of possibly NULL variable
diff --git a/genl/genl.c b/genl/genl.c
index 7ec24eb..49b6596 100644
--- a/genl/genl.c
+++ b/genl/genl.c
@@ -109,14 +109,6 @@
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 ret;
struct genl_util *a = NULL;
a = get_genl_kind(argv[1]);
- if (NULL == a) {
- fprintf(stderr,"bad genl %s\n",argv[1]);
+ if (!a) {
+ fprintf(stderr,"bad genl %s\n", argv[1]);
+ exit(-1);
}
ret = a->parse_genlopt(a, argc-1, argv+1);