diff --git a/repo/config/config.c b/repo/config/config.c index 81a89b5..9c499e0 100644 --- a/repo/config/config.c +++ b/repo/config/config.c @@ -139,7 +139,7 @@ int ipfs_repo_config_init(struct RepoConfig* config, unsigned int num_bits_for_k return 0; // swarm addresses - char* addr1 = malloc(27); + char* addr1 = malloc(64); sprintf(addr1, "/ip4/0.0.0.0/tcp/%d", swarm_port); config->addresses->swarm_head = libp2p_utils_linked_list_new(); config->addresses->swarm_head->item = malloc(strlen(addr1) + 1); @@ -155,7 +155,7 @@ int ipfs_repo_config_init(struct RepoConfig* config, unsigned int num_bits_for_k config->addresses->api = malloc(strlen(addr1)+1); strcpy(config->addresses->api, addr1); sprintf(addr1, "/ip4/127.0.0.1/tcp/%d", 8080 + port_adder); - config->addresses->gateway = malloc(strlen(addr1+1)); + config->addresses->gateway = malloc(strlen(addr1)+1); strcpy(config->addresses->gateway, addr1); free(addr1); diff --git a/test/routing/test_routing.h b/test/routing/test_routing.h index 8381426..1f0e8dc 100644 --- a/test/routing/test_routing.h +++ b/test/routing/test_routing.h @@ -65,8 +65,8 @@ int test_routing_put_value() { // see if we have what we should... libp2p_logger_debug("test_routing", "About to ask for the server to resolve the publisher.\n"); - char* args3[] = {"ipfs", "--config", ipfs_path_publisher, "resolve", peer_id_publisher}; - arguments = cli_arguments_new(5, args3); + char* args3[] = {"ipfs", "--config", ipfs_path_publisher, "name", "resolve", peer_id_publisher}; + arguments = cli_arguments_new(6, args3); if (!ipfs_name(arguments)) goto exit;