aboutsummaryrefslogtreecommitdiff
path: root/system/pdp_packet.c
diff options
context:
space:
mode:
authorTom Schouten <doelie@users.sourceforge.net>2003-02-28 09:48:54 +0000
committerTom Schouten <doelie@users.sourceforge.net>2003-02-28 09:48:54 +0000
commit8227dc75b8e236f7f9629d1bc49fae0addee3def (patch)
tree13f2aec426201ee87dd0cbda0860082315dfa1ae /system/pdp_packet.c
parenta0aef64af84622e8d6d02c7714fb82178dea0286 (diff)
pdp config
svn path=/trunk/externals/pdp/; revision=440
Diffstat (limited to 'system/pdp_packet.c')
-rw-r--r--system/pdp_packet.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/system/pdp_packet.c b/system/pdp_packet.c
index 0c0b2c2..894c443 100644
--- a/system/pdp_packet.c
+++ b/system/pdp_packet.c
@@ -80,10 +80,13 @@ pdp_packet_new(unsigned int datatype, unsigned int datasize /*without header*/)
/* remark: if p->size >= totalsize we can give away the packet */
/* but that would lead to unefficient use if we have a lot of packets */
/* of different sizes */
- if ((p->users == 0) && (p->size == totalsize) && (p->type == datatype)){
+ if ((p->users == 0) && (p->size == totalsize)){
//post("pdp_new_object: can reuse %d", i);
- p->users = 1;
- return i;
+ memset(p, 0, PDP_HEADER_SIZE); //initialize header to 0
+ p->type = datatype;
+ p->size = totalsize;
+ p->users = 1;
+ return i;
}
else{
//post("pdp_new_object: can't reuse %d, (%d users)", i, p->users);
@@ -96,6 +99,7 @@ pdp_packet_new(unsigned int datatype, unsigned int datasize /*without header*/)
align = ((unsigned int)p) & (PDP_ALIGN - 1);
if (align) post("pdp_new_object: warning data misaligned by %x", align);
pdp_stack[i] = p;
+ memset(p, 0, PDP_HEADER_SIZE); //initialize header to 0
p->type = datatype;
p->size = totalsize;
p->users = 1;