summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-26 08:54:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-11-12 17:40:27 +1000
commit6d6ae8fc8b9620bf864ac7dff8d818573eee3e4f (patch)
tree163d57b8a33b8655f44bba84c37f4f6b6c21a396 /src
parent323730f7fa70190d2ea00e62c6964fee524ca430 (diff)
Fix duplicate sizeof in copy_classes
sizeof(bla * sizeof()) is'nt right. Plus add some () to the next_block call too to emphasise that *nclasses is the multiplicator. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src')
-rw-r--r--src/XExtInt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index d74a8d4..82f5bf3 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -1481,8 +1481,8 @@ copy_classes(XIDeviceInfo* to, xXIAnyInfo* from, int *nclasses)
ptr_wire = (char*)from;
ptr_lib = to->classes;
- to->classes = next_block(&ptr_lib, *nclasses * sizeof(XIAnyClassInfo*));
- memset(to->classes, 0, sizeof(*nclasses * sizeof(XIAnyClassInfo*)));
+ to->classes = next_block(&ptr_lib, (*nclasses) * sizeof(XIAnyClassInfo*));
+ memset(to->classes, 0, (*nclasses) * sizeof(XIAnyClassInfo*));
len = 0; /* count wire length */
for (i = 0; i < *nclasses; i++)