Replace malloc/strlen/strcpy with strdup.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Matt Turner
2010-08-27 18:34:49 -04:00
parent ea239112b0
commit 08adf41f63
10 changed files with 18 additions and 40 deletions

View File

@@ -1154,8 +1154,7 @@ void
AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
{
dev->xinput_type = type;
dev->name = (char *)malloc(strlen(name) + 1);
strcpy(dev->name, name);
dev->name = strdup(name);
}
/***********************************************************************