minor cleanup for static analyser

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32514 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-03-09 10:53:25 +00:00
parent 0d5c7cb77c
commit b918c226f7
2 changed files with 13 additions and 2 deletions

View file

@ -148,8 +148,12 @@ static BOOL cacheDone = NO;
static char * xml_strdup(const char *from)
{
unsigned len = (from == 0) ? 1 : (strlen(from) + 1);
char *to = malloc(len);
unsigned len;
char *to;
if (0 == from) from = "";
len = strlen(from) + 1;
to = malloc(len);
memcpy(to, from, len);
return to;
}