xkbcomp: Replace open-coded strdup

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2010-06-15 15:13:56 +01:00
parent 5140250273
commit 50a037cacf
1 changed files with 2 additions and 3 deletions

View File

@ -246,14 +246,13 @@ XkbAddDirectoryToPath(const char *dir)
return False;
}
}
includePath[nPathEntries] =
(char *) calloc(strlen(dir) + 1, sizeof(char));
includePath[nPathEntries] = strdup(dir);
if (includePath[nPathEntries] == NULL)
{
WSGO("Allocation failed (includePath[%d])\n", nPathEntries);
return False;
}
strcpy(includePath[nPathEntries++], dir);
nPathEntries++;
return True;
}