Skip to content
Snippets Groups Projects
Commit 6a1ef68a authored by Daniel Salzman's avatar Daniel Salzman
Browse files

xfr_test: fix OpenBSD compile warning (deprecated strcpy)

parent 661d5d31
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ int main(int argc, char **argv)
int c = 0, li = 0;
int verbose = 0;
int daemonize = 0;
char* config_fn = NULL;
char *config_fn = NULL;
char *zone = NULL;
/* Long options. */
......@@ -108,7 +108,6 @@ int main(int argc, char **argv)
{0, 0, 0, 0}
};
char *buffer = NULL;
while ((c = getopt_long(argc, argv, "c:z:dvVh", opts, &li)) != -1) {
switch (c)
{
......@@ -125,10 +124,11 @@ int main(int argc, char **argv)
printf("%s, version %s\n", "Knot DNS", PACKAGE_VERSION);
return 0;
case 'z':
buffer = malloc(strlen(optarg) + 2);
strcpy(buffer, optarg);
strcat(buffer, ".");
zone = buffer;
if (optarg[strlen(optarg) - 1] != '.') {
zone = strcdup(optarg, ".");
} else {
zone = strdup(optarg);
}
break;
case 'h':
case '?':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment