bug in ppphdlc.c

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

bug in ppphdlc.c

跳至解决方案
787 次查看
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?

标签 (1)
0 项奖励
1 解答
588 次查看
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 项奖励
1 回复
589 次查看
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 项奖励