bug in ppphdlc.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bug in ppphdlc.c

Jump to solution
771 Views
Novalis
Contributor III

While checking why I cannot connect to GPRS in https://community.nxp.com/thread/380640   I am going through source code and I found a bug in  ppphdlc.c

There are 3 loops with this code:

if(fgetc(ppphdlc_ptr->DEVICE) == PPPHDLC_FLAG)

          {

            wait=0;          

          }

there is  wait--; on the next line, so it will become 0xFFFFFFFF and the loop doesn't end immediately

I would suggest to repair it like:

if(fgetc(ppphdlc_ptr->DEVICE) == PPPHDLC_FLAG)

          {

            wait=0;

            continue;

          }

BTW: wouldn't it be better to do things like this (protocol parsing) with state machine?

PS: is this the right place to write things like this, or should I report it somewhere else so that it gets to the right people?

Labels (1)
0 Kudos
1 Solution
572 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Martin:

We have noticed this bug and reported it to the developer team, thank you for your sharing.

Regards

Daniel

View solution in original post

0 Kudos
1 Reply
573 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Martin:

We have noticed this bug and reported it to the developer team, thank you for your sharing.

Regards

Daniel

0 Kudos