[PATCH] xf86VIDrvMsgVerb: Use provided format if asprintf fails

Daniel Kurtz djkurtz at google.com
Thu Jul 21 21:01:07 PDT 2011


If asprintf fails when attempting to allocate space for the driver name,
use the originally requested format, instead of just "%s".

Signed-off-by: Daniel Kurtz <djkurtz at google.com>
---
 hw/xfree86/common/xf86Helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 3cdffdb..b19d1a0 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1091,7 +1091,7 @@ xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *forma
 
     if (asprintf(&msg, "%s: %s: %s", dev->drv->driverName, dev->name, format)
 	== -1) {
-	LogVMessageVerb(type, verb, "%s", args);
+	LogVMessageVerb(type, verb, format, args);
     } else {
 	LogVMessageVerb(type, verb, msg, args);
 	free(msg);
-- 
1.7.3.1



More information about the xorg-devel mailing list