diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-26 08:54:53 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-16 07:35:00 +1000 |
commit | 30bff38c7436daad4140fedf867c546bea839b93 (patch) | |
tree | 080de24640999e6bee150ab001f97af1c0555d8c | |
parent | db739c0770d49e8b47da90f160b99c76be996a18 (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>
(cherry picked from commit 6d6ae8fc8b9620bf864ac7dff8d818573eee3e4f)
-rw-r--r-- | src/XExtInt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c index 2ce2d44..a5e70b5 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -1463,8 +1463,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++) |