aboutsummaryrefslogtreecommitdiff
path: root/src/libmach
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2010-03-10 14:50:33 -0800
committerRuss Cox <rsc@swtch.com>2010-03-10 14:50:33 -0800
commit0c9c620f39e56c42802504003fd05664aba670a4 (patch)
treead14a1a51f3b6193d0603725d62a34fbc4647c49 /src/libmach
parent2fe14f1315eb8d3235ea8f978e5bd9444f467c2b (diff)
downloadplan9port-0c9c620f39e56c42802504003fd05664aba670a4.tar.gz
plan9port-0c9c620f39e56c42802504003fd05664aba670a4.tar.bz2
plan9port-0c9c620f39e56c42802504003fd05664aba670a4.zip
fix type-punned pointer warnings from gcc
R=rsc http://codereview.appspot.com/396042
Diffstat (limited to 'src/libmach')
-rw-r--r--src/libmach/Linux.c6
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;