avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bugs #10420] sscanf(), If there is a decimal number foll


From: anonymous
Subject: [avr-libc-dev] [bugs #10420] sscanf(), If there is a decimal number followed by the character '_' in the buffer, you can't get the the number.
Date: Thu, 16 Sep 2004 23:38:03 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; MyIE2)

This mail is an automated notification from the bugs tracker
 of the project: AVR C Runtime Library.




/**************************************************************************/
[bugs #10420] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10420>
Project: AVR C Runtime Library
Submitted by: 0
On: Thu 09/16/04 at 23:32

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Email:  address@hidden
Status:  Open


Summary:  sscanf(),  If there is a decimal number followed by the character '_' 
 in the buffer, you can't get the the number. 

Original Submission:  I think there may be some troubles with the function 
sscanf(),

Lets have a look at the following example:

void mc(void)
{
    char buf[64] = "<1/dr_2_600";
    int addr,port,speed;

    sscanf(buf,"<%d/dr_%d_%d",&addr,&port,&speed);
    printf("addr=%d,port=%d,speed=%dn",addr,port,speed);
    return;
}

The expecting results are: addr=1, port=2,speed=600.
However,the actual results are: addr=1,port=28600, and 'speed' gets a invalid 
value.

















For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10420>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]