diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2018-10-30 00:00:45 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-09 15:31:57 +0100 |
commit | b09a72b08c7effeac42652f087f0b8f16bc74763 (patch) | |
tree | 563983a65e7f6b6c7e8acf44f4c30d9f1364fc7b /nx-X11/programs/Xserver/xkb/ddxList.c | |
parent | b01e29efffafe9f426eb88ba400e2fa24de548aa (diff) | |
download | nx-libs-b09a72b08c7effeac42652f087f0b8f16bc74763.tar.gz nx-libs-b09a72b08c7effeac42652f087f0b8f16bc74763.tar.bz2 nx-libs-b09a72b08c7effeac42652f087f0b8f16bc74763.zip |
Convert existing Xprintf style calls to asprintf style
This commit + some more adaption in ddxLoad.c which where no longer
present when Alan did the patch. However, our code still has them:
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Nov 27 20:09:04 2010 -0800
Convert existing Xprintf style calls to asprintf style
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/programs/Xserver/xkb/ddxList.c')
-rw-r--r-- | nx-X11/programs/Xserver/xkb/ddxList.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 5466cff37..cc95c8603 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -162,34 +162,46 @@ 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( + 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)), + 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"); + buf = NULL; } if (!in) { haveDir= False; free(buf); - buf = Xprintf( + if (asprintf + (&buf, "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, - componentDirs[what],(long) - ((xkbDebugFlags<2)?1:((xkbDebugFlags>10)?10:xkbDebugFlags)), + componentDirs[what], + (long) ((xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)), file W32_tmpfile - ); + ) == -1) + buf = NULL; } } status= Success; |