summaryrefslogtreecommitdiff
path: root/tools/d2c/d2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c/d2c.c')
-rw-r--r--tools/d2c/d2c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/d2c/d2c.c b/tools/d2c/d2c.c
index 9cb2df4..fddee6a 100644
--- a/tools/d2c/d2c.c
+++ b/tools/d2c/d2c.c
@@ -196,7 +196,7 @@ int main(int argc, char **argv)
break;
case 'o':
- info.directory = optarg;
+ asprintf(&info.opcodes_dir, "%sopcodes%c", optarg, optarg[strlen(optarg) - 1]);
break;
case 't':
@@ -274,7 +274,7 @@ int main(int argc, char **argv)
if (execute == ADC_NONE)
has_error = true;
- if (info.directory == NULL || info.arch == NULL || info.arch_cn == NULL || info.guard == NULL)
+ if (info.opcodes_dir == NULL || info.arch == NULL || info.arch_cn == NULL || info.guard == NULL)
has_error = true;
if (need_help || has_error || (optind + 1) != argc)
@@ -372,6 +372,9 @@ int main(int argc, char **argv)
exit:
+ if (info.opcodes_dir != NULL)
+ free(info.opcodes_dir);
+
return result;
}