aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Helper.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index 9b6daaf41..8f61c4c72 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -1193,9 +1193,13 @@ xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *forma
{
char *msg;
- msg = Xprintf("%s: %s: %s", dev->drv->driverName, dev->name, format);
- LogVMessageVerb(type, verb, msg, args);
- free(msg);
+ if (asprintf(&msg, "%s: %s: %s", dev->drv->driverName, dev->name, format)
+ == -1) {
+ LogVMessageVerb(type, verb, "%s", args);
+ } else {
+ LogVMessageVerb(type, verb, msg, args);
+ free(msg);
+ }
}
/* Print input driver message, with verbose level specified directly */
@@ -1280,11 +1284,8 @@ xf86LogInit(void)
/* Get the log file name */
if (xf86LogFileFrom == X_DEFAULT) {
/* Append the display number and ".log" */
- lf = malloc(strlen(xf86LogFile) + strlen("%s") +
- strlen(LOGSUFFIX) + 1);
- if (!lf)
+ if (asprintf(&lf, "%s%%s" LOGSUFFIX, xf86LogFile) == -1)
FatalError("Cannot allocate space for the log file name\n");
- sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile);
xf86LogFile = lf;
}