1
0

Of course... Forgot the slashes in path. xD

This commit is contained in:
Alexander Andreev 2024-03-31 23:31:19 +04:00
parent 597cc3d293
commit 8d2f97a87d
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -348,17 +348,19 @@ int parse_argv(int argc, const char **argv, struct options *opts) {
return 1; return 1;
} }
opts->addressbook_path = (char *)malloc(config_dir_len + 11 + 1); opts->addressbook_path = (char *)malloc(config_dir_len + 12 + 1);
strncpy(opts->addressbook_path, config_dir, config_dir_len); strncpy(opts->addressbook_path, config_dir, config_dir_len);
strcat(opts->addressbook_path, "addressbook"); strcat(opts->addressbook_path, "/addressbook");
opts->key_pub_path = (char *)malloc(config_dir_len + 11 + 1); opts->key_pub_path = (char *)malloc(config_dir_len + 12 + 1);
strncpy(opts->key_pub_path, config_dir, config_dir_len); strncpy(opts->key_pub_path, config_dir, config_dir_len);
strcat(opts->key_pub_path, "own_pub_key"); strcat(opts->key_pub_path, "/own_pub_key");
opts->key_sec_path = (char *)malloc(config_dir_len + 11 + 1); opts->key_sec_path = (char *)malloc(config_dir_len + 12 + 1);
strncpy(opts->key_sec_path, config_dir, config_dir_len); strncpy(opts->key_sec_path, config_dir, config_dir_len);
strcat(opts->key_sec_path, "own_sec_key"); strcat(opts->key_sec_path, "/own_sec_key");
printf("%s:%s:%s\n", opts->addressbook_path, opts->key_pub_path, opts->key_sec_path);
free(config_dir); free(config_dir);