Xi: don't crash on a NULL property name, just return None.

strcmp doesn't like NULL-pointers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 0d9a42dc03)
This commit is contained in:
Peter Hutterer 2009-03-09 08:59:01 +10:00 committed by Adam Jackson
parent ea9f51fd42
commit 124da1da5c

View file

@ -58,11 +58,17 @@ static long XIPropHandlerID = 1;
/**
* Return the type assigned to the specified atom or 0 if the atom isn't known
* to the DIX.
*
* If name is NULL, None is returned.
*/
_X_EXPORT Atom
XIGetKnownProperty(char *name)
{
int i;
if (!name)
return None;
for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
{
if (strcmp(name, dev_properties[i].name) == 0)