Specific copy functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1446 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
18
lib/asn1/der_copy.c
Normal file
18
lib/asn1/der_copy.c
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include "asn1_locl.h"
|
||||||
|
|
||||||
|
RCSID("$Id$");
|
||||||
|
|
||||||
|
void
|
||||||
|
copy_general_string (char **from, char **to)
|
||||||
|
{
|
||||||
|
*to = malloc(strlen(*from) + 1);
|
||||||
|
strcpy(*to, *from);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
copy_octet_string (krb5_data *from, krb5_data *to)
|
||||||
|
{
|
||||||
|
to->len = from->len;
|
||||||
|
to->data = malloc(to->len);
|
||||||
|
memcpy(to->data, from->data, to->len);
|
||||||
|
}
|
Reference in New Issue
Block a user