bug in ppphdlc.c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
788件の閲覧回数
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 解決策
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 件の賞賛
1 返信
590件の閲覧回数
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 件の賞賛