From 50a037cacf75b106a2ee31680fb4588a8873a262 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 15 Jun 2010 15:13:56 +0100 Subject: [PATCH] xkbcomp: Replace open-coded strdup Signed-off-by: Daniel Stone --- src/xkbcomp/xkbpath.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xkbcomp/xkbpath.c b/src/xkbcomp/xkbpath.c index 9281421..b67ac46 100644 --- a/src/xkbcomp/xkbpath.c +++ b/src/xkbcomp/xkbpath.c @@ -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; } -- 2.7.4