Skip to content

Commit

Permalink
Fix warnings regarding pointer arithmetics with void *
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jan 31, 2023
1 parent 9b7f216 commit e1d6f5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pecoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ coff_add (struct backtrace_state *state, int descriptor,
magic_ok = memcmp (magic, "PE\0", 4) == 0;
fhdr_off += 4;

memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);
memcpy (&fhdr, magic + 4, sizeof fhdr);
}
else
{
Expand Down Expand Up @@ -678,7 +678,7 @@ coff_add (struct backtrace_state *state, int descriptor,
sects_view_valid = 1;
opt_hdr = (const b_coff_optional_header *) sects_view.data;
sects = (const b_coff_section_header *)
(sects_view.data + fhdr.size_of_optional_header);
(void *)((const char *)sects_view.data + fhdr.size_of_optional_header);

if (fhdr.size_of_optional_header > sizeof (*opt_hdr))
{
Expand Down Expand Up @@ -718,7 +718,7 @@ coff_add (struct backtrace_state *state, int descriptor,
goto fail;
syms_view_valid = 1;

str_size = coff_read4 (syms_view.data + syms_size);
str_size = coff_read4 ((const unsigned char *)syms_view.data + syms_size);

str_off = syms_off + syms_size;

Expand Down

0 comments on commit e1d6f5a

Please sign in to comment.