// Main entry point
int main(int argc, char **argv) {
- char *dst_dir = NULL;
+ char dst_dir[PATH_MAX];
int confirmed = 0;
static DB_ENV *dst_dbenv; // Target DB environment
"\033[44m\033[33m\033[1m is subject to the terms of the GNU General Public license v3. \033[K\033[0m\n"
"\033[44m\033[33m\033[1m \033[K\033[0m\n");
+ // Default destination directory unless overridden
+ snprintf(dst_dir, sizeof(dst_dir), "%s/data", CTDLDIR);
+
// Parse command line
int a;
while ((a = getopt(argc, argv, "h:y")) != EOF) {
switch (a) {
case 'h':
- dst_dir = optarg;
+ snprintf(dst_dir, sizeof(dst_dir), "%s/data", optarg);
break;
case 'y':
confirmed = 1;