summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-22 13:50:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-12-22 13:50:53 +0000
commit58d9912e447cf6e29b20747b5ed6ee595687ce8d (patch)
tree4a482b0aae43d17fc9a2e2f26e141a7b26768694
parente8db77e019e19ace48592b2f6d96af6baa9a228e (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>
-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 962ee504..f09203a7 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -354,26 +354,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)