aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86ShowOpts.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86ShowOpts.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86ShowOpts.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86ShowOpts.c b/xorg-server/hw/xfree86/common/xf86ShowOpts.c
index 831e6b787..7aa79eb6a 100644
--- a/xorg-server/hw/xfree86/common/xf86ShowOpts.c
+++ b/xorg-server/hw/xfree86/common/xf86ShowOpts.c
@@ -97,11 +97,8 @@ void DoShowOptions (void) {
);
continue;
}
- pSymbol = malloc(
- strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1
- );
- strcpy (pSymbol, xf86DriverList[i]->driverName);
- strcat (pSymbol, "ModuleData");
+ XNFasprintf(&pSymbol, "%sModuleData",
+ xf86DriverList[i]->driverName);
initData = LoaderSymbol (pSymbol);
if (initData) {
XF86ModuleVersionInfo *vers = initData->vers;
@@ -111,6 +108,9 @@ void DoShowOptions (void) {
);
for (p = pOption; p->name != NULL; p++) {
const char *opttype = optionTypeToSting(p->type);
+ /* XXX: Why overallocate by 2 bytes?
+ * Otherwise, this would be strdup()
+ */
char *optname = malloc(strlen(p->name) + 2 + 1);
if (!optname) {
continue;