player: memset packets to zero
This commit is contained in:
parent
d870849e4c
commit
acd07331a4
|
@ -183,6 +183,8 @@ uint8_t joinGame()
|
||||||
int i;
|
int i;
|
||||||
struct packet p;
|
struct packet p;
|
||||||
struct packet ack;
|
struct packet ack;
|
||||||
|
memset((void*)&p, 0, sizeof(p));
|
||||||
|
memset((void*)&ack, 0, sizeof(ack));
|
||||||
p.len=sizeof(p);
|
p.len=sizeof(p);
|
||||||
p.protocol='G';
|
p.protocol='G';
|
||||||
p.command='J';
|
p.command='J';
|
||||||
|
@ -288,6 +290,7 @@ uint8_t selectGame()
|
||||||
void processNickRequest( struct nickrequest *nq)
|
void processNickRequest( struct nickrequest *nq)
|
||||||
{
|
{
|
||||||
struct packet p;
|
struct packet p;
|
||||||
|
memset((void*)&p, 0, sizeof(p));
|
||||||
p.len=sizeof(p);
|
p.len=sizeof(p);
|
||||||
p.protocol='G'; // Proto
|
p.protocol='G'; // Proto
|
||||||
p.command='n';
|
p.command='n';
|
||||||
|
@ -304,6 +307,7 @@ void processPacket(struct packet *p)
|
||||||
if ((p->len==32) && (p->protocol=='G') && (p->id == id || p->id == 0) ){ //check sanity, protocol, id
|
if ((p->len==32) && (p->protocol=='G') && (p->id == id || p->id == 0) ){ //check sanity, protocol, id
|
||||||
if (p->command=='T'){
|
if (p->command=='T'){
|
||||||
struct packet ack;
|
struct packet ack;
|
||||||
|
memset((void*)&ack, 0, sizeof(ack));
|
||||||
ack.len=sizeof(p);
|
ack.len=sizeof(p);
|
||||||
ack.protocol='G';
|
ack.protocol='G';
|
||||||
ack.command='a';
|
ack.command='a';
|
||||||
|
@ -354,6 +358,7 @@ void processText(struct text *t)
|
||||||
void sendButton(uint8_t button)
|
void sendButton(uint8_t button)
|
||||||
{
|
{
|
||||||
struct packet p;
|
struct packet p;
|
||||||
|
memset((void*)&p, 0, sizeof(p));
|
||||||
p.len=sizeof(p);
|
p.len=sizeof(p);
|
||||||
p.protocol='G'; // Proto
|
p.protocol='G'; // Proto
|
||||||
p.command='B';
|
p.command='B';
|
||||||
|
|
Loading…
Reference in New Issue