mirror of
https://github.com/golang/go
synced 2024-11-21 16:14:42 -07:00
libmach: fix incorrect use of memset
Fixes #2213. R=rsc CC=golang-dev https://golang.org/cl/4975047
This commit is contained in:
parent
b0bd77f8fb
commit
ae502c4e02
@ -811,7 +811,7 @@ elf64dotout(int fd, Fhdr *fp, ExecHdr *hp)
|
||||
buf = malloc(sh[ep->shstrndx].size);
|
||||
if (buf == 0)
|
||||
goto done;
|
||||
memset(buf, 0, sizeof buf);
|
||||
memset(buf, 0, sh[ep->shstrndx].size);
|
||||
seek(fd, sh[ep->shstrndx].offset, 0);
|
||||
i = read(fd, buf, sh[ep->shstrndx].size);
|
||||
USED(i); // shut up ubuntu gcc
|
||||
@ -989,7 +989,7 @@ elfdotout(int fd, Fhdr *fp, ExecHdr *hp)
|
||||
buf = malloc(sh[ep->shstrndx].size);
|
||||
if (buf == 0)
|
||||
goto done;
|
||||
memset(buf, 0, sizeof buf);
|
||||
memset(buf, 0, sh[ep->shstrndx].size);
|
||||
seek(fd, sh[ep->shstrndx].offset, 0);
|
||||
i = read(fd, buf, sh[ep->shstrndx].size);
|
||||
USED(i); // shut up ubuntu gcc
|
||||
|
Loading…
Reference in New Issue
Block a user