summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-22 13:50:53 +0000
committerOwain G. Ainsworth <oga@openbsd.org>2011-05-29 23:06:10 +0100
commit69533fb0dd0fea11cb32bb64865164cb4a9bce6b (patch)
tree214963e347129d6b0ccdbaf4b08e21f1d0d78743
parent8b9178c50ee0b8ba142b69e26e1e0d39979a6f05 (diff)
Remove the deprecated function 'XNFprintf'
As we know the maximum length of the string, we can replace our single usage of XNFprintf with snprintf. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit 58d9912e447cf6e29b20747b5ed6ee595687ce8d) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/intel_driver.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 6288f9ee..4fcd21aa 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -1167,26 +1167,22 @@ static Bool intel_open_drm_master(ScrnInfoPtr scrn)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
struct pci_device *dev = intel->PciInfo;
- char *busid;
drmSetVersion sv;
struct drm_i915_getparam gp;
int err, has_gem;
+ char busid[20];
- /* We wish we had asprintf, but all we get is XNFprintf. */
- busid = XNFprintf("pci:%04x:%02x:%02x.%d",
- dev->domain, dev->bus, dev->dev, dev->func);
+ snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d",
+ dev->domain, dev->bus, dev->dev, dev->func);
intel->drmSubFD = drmOpen("i915", busid);
if (intel->drmSubFD == -1) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"[drm] Failed to open DRM device for %s: %s\n",
busid, strerror(errno));
- free(busid);
return FALSE;
}
- free(busid);
-
/* Check that what we opened was a master or a master-capable FD,
* by setting the version of the interface we'll use to talk to it.
* (see DRIOpenDRMMaster() in DRI1)