summaryrefslogtreecommitdiff
path: root/xkbprint.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 20:55:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-27 20:55:37 -0700
commitbfb6044479e8e974e848f47969f75b84865fea13 (patch)
treed8631e32a64744389b9c6e2291ff901f771c0745 /xkbprint.c
parent7848ba1d292f55553058c1f17596baa1094cdae5 (diff)
Replace several malloc+sprintf pairs with asprintf() calls
Includes fallback uAsprintf() for systems without asprintf yet Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xkbprint.c')
-rw-r--r--xkbprint.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xkbprint.c b/xkbprint.c
index 41ebec3..fe2219d 100644
--- a/xkbprint.c
+++ b/xkbprint.c
@@ -26,6 +26,10 @@
********************************************************/
/* $XFree86: xc/programs/xkbprint/xkbprint.c,v 3.10 2003/05/27 22:27:07 tsi Exp $ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <ctype.h>
#include <X11/Xlocale.h>
@@ -421,8 +425,7 @@ parseArgs(int argc, char *argv[])
FILE *file = NULL;
if (outputFile == NULL) {
- outputFile = malloc(strlen(outputFont) + 5);
- sprintf(outputFile, "%s.pfa", outputFont);
+ asprintf(&outputFile, "%s.pfa", outputFont);
}
else if (uStringEqual(outputFile, "-"))
file = stdout;