summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Configure.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 11:07:24 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:57:07 -0700
commitf3ba909753cd216fc9eca4618a76cc283ccbf51e (patch)
tree1b48b1c08c341b26ed8d74e339308893021dccbe /hw/xfree86/common/xf86Configure.c
parenta28202a148508837911c5932a0d14af4b145bece (diff)
Let calloc handle multiplication
It's going to multiply anyway, so if we have non-constant values, might as well let it do the multiplication instead of adding another multiply, and good versions of calloc will check for & avoid overflow in the process. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/xfree86/common/xf86Configure.c')
-rw-r--r--hw/xfree86/common/xf86Configure.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index cc7ff1bb5..7ab378f59 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -645,10 +645,10 @@ DoConfigure(void)
xf86DoConfigurePass1 = FALSE;
- dev2screen = xnfcalloc(1, xf86NumDrivers * sizeof(int));
+ dev2screen = xnfcalloc(xf86NumDrivers, sizeof(int));
{
- Bool *driverProbed = xnfcalloc(1, xf86NumDrivers * sizeof(Bool));
+ Bool *driverProbed = xnfcalloc(xf86NumDrivers, sizeof(Bool));
for (screennum = 0; screennum < nDevToConfig; screennum++) {
int k, l, n, oldNumScreens;