aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-07-03 16:30:08 +0200
committerMartin Willi <martin@strongswan.org>2009-07-06 13:15:28 +0200
commit2147da40a5d79ca7921c028d38fe9503feb42bfb (patch)
tree2c7f6d4d3951854f92eca394b626d3c03d37e7d2
parent6bdd79d86c2a53587437f8b3d2f25578e0cec290 (diff)
downloadstrongswan-2147da40a5d79ca7921c028d38fe9503feb42bfb.tar.bz2
strongswan-2147da40a5d79ca7921c028d38fe9503feb42bfb.tar.xz
simplified identification_t.clone() using memcpy
-rw-r--r--src/libstrongswan/utils/identification.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c
index 72b1c6a59..a257747d5 100644
--- a/src/libstrongswan/utils/identification.c
+++ b/src/libstrongswan/utils/identification.c
@@ -267,8 +267,6 @@ static enumerator_t* create_part_enumerator(private_identification_t *this)
}
}
-static private_identification_t *identification_create(void);
-
/**
* updates a chunk (!????)
* TODO: We should reconsider this stuff, its not really clear
@@ -1067,16 +1065,13 @@ int identification_printf_hook(char *dst, size_t len, printf_hook_spec_t *spec,
*/
static identification_t *clone_(private_identification_t *this)
{
- private_identification_t *clone = identification_create();
+ private_identification_t *clone = malloc_thing(private_identification_t);
- clone->type = this->type;
+ memcpy(clone, this, sizeof(private_identification_t));
if (this->encoded.len)
{
clone->encoded = chunk_clone(this->encoded);
}
- clone->public.equals = this->public.equals;
- clone->public.matches = this->public.matches;
-
return &clone->public;
}