summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-11-27 20:09:04 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-12-07 11:10:35 -0800
commit03e8bfa1d122f7dea905d48c93cfd54afd991dfd (patch)
tree7b52cac0f43bb7f79ab9ec62054c74a18d8a28f2 /hw/xfree86
parentc95c1d338fdb62dbe3dba934b97324fa778b7fce (diff)
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>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c4
-rw-r--r--hw/xfree86/common/xf86Config.c9
-rw-r--r--hw/xfree86/common/xf86Helper.c10
-rw-r--r--hw/xfree86/modes/xf86Modes.c4
4 files changed, 15 insertions, 12 deletions
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 3cd5ef6ff..eb61f879a 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -297,8 +297,8 @@ copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver)
}
memcpy(cptr, odev, sizeof(GDevRec));
- cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver);
- if (!cptr->identifier) {
+ if (asprintf(&cptr->identifier, "Autoconfigured Video Device %s", driver)
+ == -1) {
free(cptr);
free(nscreen);
return FALSE;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index ae9592e24..5f3b8e8be 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -585,12 +585,11 @@ configFiles(XF86ConfFilesPtr fileconf)
else if (fileconf && fileconf->file_fontpath) {
pathFrom = X_CONFIG;
if (xf86Info.useDefaultFontPath) {
- defaultFontPath = Xprintf("%s%s%s",
- fileconf->file_fontpath,
- *temp_path ? "," : "", temp_path);
- if (defaultFontPath != NULL) {
+ if (asprintf(&defaultFontPath, "%s%s%s", fileconf->file_fontpath,
+ *temp_path ? "," : "", temp_path) == -1)
+ defaultFontPath = NULL;
+ else
must_copy = FALSE;
- }
}
else
defaultFontPath = fileconf->file_fontpath;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 01f9864bb..ce144544b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/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 */
diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 51eb4c952..75584cf87 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -132,8 +132,8 @@ xf86SetModeDefaultName(DisplayModePtr mode)
free(mode->name);
- mode->name = XNFprintf("%dx%d%s", mode->HDisplay, mode->VDisplay,
- interlaced ? "i" : "");
+ XNFasprintf(&mode->name, "%dx%d%s", mode->HDisplay, mode->VDisplay,
+ interlaced ? "i" : "");
}
/*