summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/args.c2
-rw-r--r--src/main.c5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/args.c b/src/args.c
index 8261c81..99267b1 100644
--- a/src/args.c
+++ b/src/args.c
@@ -118,7 +118,7 @@ int parseargs(int argc, char *args[])
ARGS = (arg *)realloc(ARGS, argscap * sizeof(arg));
}
ARGS[ARGC].type = pa->type;
- ARGS[ARGC].flag = a;
+ ARGS[ARGC].flag = pa->flag;
ARGS[ARGC].numopt = pa->numopt;
ARGS[ARGC].runarg = pa->runarg;
ARGS[ARGC].opts = (char **)malloc(pa->numopt * sizeof(char *));
diff --git a/src/main.c b/src/main.c
index a688cb6..ed15eb7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -151,15 +151,12 @@ int main(int argc, char *argv[])
printf("For more help run 'dedit --help'\n");
}
- if (argc == 1)
+ if (argc == 1 || getopt("-h", 0))
{
printhelp();
exit(EXIT_SUCCESS);
}
- if (getopt("-h", 0))
- printhelp();
-
arg *demoarg = getarg(0);
if (demoarg == NULL)
{