This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] gelf_getauxv: Use memcpy instead of pointer dereference to avoid alignment problems.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 27 Aug 2013 23:28:15 +0200
- Subject: Re: [PATCH] gelf_getauxv: Use memcpy instead of pointer dereference to avoid alignment problems.
On Tue, 2013-08-27 at 09:47 -0700, Roland McGrath wrote:
> > - memcpy(dst, (char *) data_scn->d.d_buf + ndx * sizeof (GElf_auxv_t),
> > + memcpy(dst, data_scn->d.d_buf + ndx * sizeof (GElf_auxv_t),
> > sizeof (GElf_auxv_t));
>
> This still has a missing space and the indentation is off.
Please next time do point out exactly where (or provide a patch).
Missing or extra whitespace is always hard to see. I really didn't spot
it. But Josh helped me see the light. I am assuming you mean:
diff --git a/libelf/gelf_getauxv.c b/libelf/gelf_getauxv.c
index 6b91030..a2f04e7 100644
--- a/libelf/gelf_getauxv.c
+++ b/libelf/gelf_getauxv.c
@@ -97,8 +97,8 @@ gelf_getauxv (data, ndx, dst)
goto out;
}
- memcpy(dst, data_scn->d.d_buf + ndx * sizeof (GElf_auxv_t),
- sizeof (GElf_auxv_t));
+ memcpy (dst, data_scn->d.d_buf + ndx * sizeof (GElf_auxv_t),
+ sizeof (GElf_auxv_t));
}
result = dst;
I'll check that in,
Mark