(copy_general_string): use strdup

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12087 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-04-17 07:13:08 +00:00
parent bdef0a4d2b
commit 21f95ad266

View File

@@ -38,10 +38,9 @@ RCSID("$Id$");
int int
copy_general_string (const general_string *from, general_string *to) copy_general_string (const general_string *from, general_string *to)
{ {
*to = malloc(strlen(*from) + 1); *to = strdup(*from);
if(*to == NULL) if(*to == NULL)
return ENOMEM; return ENOMEM;
strcpy(*to, *from);
return 0; return 0;
} }