tools: Fix memset(&p,0,sizeof(p)) idiom in several places.

gcc 4.8 identifies several places where code of the form memset(x, 0,
sizeof(x)); is used incorrectly, meaning that less memory is set to
zero than required.

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Committed-by: Keir Fraser <keir@xen.org>
This commit is contained in:
Michael Young committed 2013-02-13 17:00:15 +00:00
1 parent b61ed421d2
commit d119301b58
6 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -333,7 +333,7 @@ int kdd_get_regs(kdd_guest *g, int cpuid, kdd_regs *r, int w64)
if (!cpu)
return -1;
memset(r, 0, sizeof(r));
memset(r, 0, sizeof(*r));
if (w64)
kdd_get_regs_x86_64(cpu, &r->r64);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.