aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r--xorg-server/xkb/ddxList.c43
-rw-r--r--xorg-server/xkb/ddxLoad.c19
2 files changed, 38 insertions, 24 deletions
diff --git a/xorg-server/xkb/ddxList.c b/xorg-server/xkb/ddxList.c
index 16bca16db..e62078de8 100644
--- a/xorg-server/xkb/ddxList.c
+++ b/xorg-server/xkb/ddxList.c
@@ -156,34 +156,45 @@ char tmpname[PATH_MAX];
#endif
if (XkbBaseDirectory!=NULL) {
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
- buf = Xprintf("%s/%s.dir",XkbBaseDirectory,componentDirs[what]);
- in= fopen(buf,"r");
+ if (asprintf(&buf, "%s/%s.dir", XkbBaseDirectory,
+ componentDirs[what]) == -1)
+ buf = NULL;
+ else
+ in = fopen(buf,"r");
}
if (!in) {
haveDir= FALSE;
free(buf);
- buf = Xprintf(
- "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg,
- XkbBinDirectory,XkbBaseDirectory,componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file W32_tmpfile
- );
+ if (asprintf
+ (&buf,
+ "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg,
+ XkbBinDirectory, XkbBaseDirectory, componentDirs[what],
+ (long) ((xkbDebugFlags < 2) ? 1 :
+ ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)),
+ file W32_tmpfile
+ ) == -1)
+ buf = NULL;
}
}
else {
if ((list->pattern[what][0]=='*')&&(list->pattern[what][1]=='\0')) {
- buf = Xprintf("%s.dir",componentDirs[what]);
- in= fopen(buf,"r");
+ if (asprintf(&buf, "%s.dir", componentDirs[what]) == -1)
+ buf = NULL;
+ else
+ in = fopen(buf,"r");
}
if (!in) {
haveDir= FALSE;
free(buf);
- buf = Xprintf(
- "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg,
- componentDirs[what],(long)
- ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)),
- file W32_tmpfile
- );
+ if (asprintf
+ (&buf,
+ "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg,
+ componentDirs[what],
+ (long) ((xkbDebugFlags < 2) ? 1 :
+ ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)),
+ file W32_tmpfile
+ ) == -1)
+ buf = NULL;
}
}
status= Success;
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c
index 03de218ab..cde181c64 100644
--- a/xorg-server/xkb/ddxLoad.c
+++ b/xorg-server/xkb/ddxLoad.c
@@ -210,7 +210,8 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
#endif
if (XkbBaseDirectory != NULL) {
- xkbbasedirflag = Xprintf("\"-R%s\"", XkbBaseDirectory);
+ if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1)
+ xkbbasedirflag = NULL;
}
if (XkbBinDirectory != NULL) {
@@ -225,14 +226,16 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
}
}
- buf = Xprintf("\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
+ if (asprintf(&buf,
+ "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
"-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
- xkbbindir, xkbbindirsep,
- ( (xkbDebugFlags < 2) ? 1 :
- ((xkbDebugFlags > 10) ? 10 : (int)xkbDebugFlags) ),
- xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
- PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
- xkm_output_dir, keymap);
+ xkbbindir, xkbbindirsep,
+ ((xkbDebugFlags < 2) ? 1 :
+ ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)),
+ xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
+ PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
+ xkm_output_dir, keymap) == -1)
+ buf = NULL;
free(xkbbasedirflag);