projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a9a803d
)
Use xstrdup() instead of xasprintf() to copy static strings.
author
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 23 Dec 2009 18:51:55 +0000
(19:51 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 23 Dec 2009 18:51:55 +0000
(19:51 +0100)
src/net_setup.c
patch
|
blob
|
history
diff --git
a/src/net_setup.c
b/src/net_setup.c
index
cbf631f
..
0718a8c
100644
(file)
--- a/
src/net_setup.c
+++ b/
src/net_setup.c
@@
-218,8
+218,8
@@
bool setup_myself(void) {
myself->connection = new_connection();
init_configuration(&myself->connection->config_tree);
myself->connection = new_connection();
init_configuration(&myself->connection->config_tree);
-
xasprintf(&myself->hostname,
"MYSELF");
-
xasprintf(&myself->connection->hostname,
"MYSELF");
+
myself->hostname = xstrdup(
"MYSELF");
+
myself->connection->hostname = xstrdup(
"MYSELF");
myself->connection->options = 0;
myself->connection->protocol_version = PROT_CURRENT;
myself->connection->options = 0;
myself->connection->protocol_version = PROT_CURRENT;
@@
-247,7
+247,7
@@
bool setup_myself(void) {
return false;
if(!get_config_string(lookup_config(myself->connection->config_tree, "Port"), &myport))
return false;
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 */