Use xstrdup() instead of xasprintf() to copy static strings.

This commit is contained in:
Guus Sliepen 2009-12-23 19:51:55 +01:00
parent a9a803d566
commit 7203d5fb07

View file

@ -218,8 +218,8 @@ bool setup_myself(void) {
myself->connection = new_connection(); myself->connection = new_connection();
init_configuration(&myself->connection->config_tree); init_configuration(&myself->connection->config_tree);
xasprintf(&myself->hostname, "MYSELF"); myself->hostname = xstrdup("MYSELF");
xasprintf(&myself->connection->hostname, "MYSELF"); myself->connection->hostname = xstrdup("MYSELF");
myself->connection->options = 0; myself->connection->options = 0;
myself->connection->protocol_version = PROT_CURRENT; myself->connection->protocol_version = PROT_CURRENT;
@ -247,7 +247,7 @@ bool setup_myself(void) {
return false; return false;
if(!get_config_string(lookup_config(myself->connection->config_tree, "Port"), &myport)) if(!get_config_string(lookup_config(myself->connection->config_tree, "Port"), &myport))
xasprintf(&myport, "655"); myport = xstrdup("655");
/* Read in all the subnets specified in the host configuration file */ /* Read in all the subnets specified in the host configuration file */