xkbcomp: Replace open-coded strdup
Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
5140250273
commit
50a037cacf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue