diff options
Diffstat (limited to 'src/libmach')
-rw-r--r-- | src/libmach/Linux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libmach/Linux.c b/src/libmach/Linux.c index eb01a6e6..2a06f6a1 100644 --- a/src/libmach/Linux.c +++ b/src/libmach/Linux.c @@ -146,7 +146,7 @@ ptracerw(int type, int xtype, int isr, int pid, ulong addr, void *v, uint n) if(n-i >= 4) *(u32int*)((char*)v+i) = u; else{ - *(u32int*)buf = u; + memmove(buf, &u, 4); memmove((char*)v+i, buf, n-i); } }else{ @@ -157,9 +157,9 @@ ptracerw(int type, int xtype, int isr, int pid, ulong addr, void *v, uint n) u = ptrace(xtype, pid, addr+i, 0); if(errno) return -1; - *(u32int*)buf = u; + memmove(buf, &u, 4); memmove(buf, (char*)v+i, n-i); - u = *(u32int*)buf; + memmove(&u, buf, 4); } if(ptrace(type, pid, addr+i, u) < 0) goto ptraceerr; |