bugAVR C Runtime Library - Bugs: bug #10420, sscanf(), If there is a decimal...

 
 

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

Submitted by:  None
Submitted on:  Fri 17 Sep 2004 03:32:25 AM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPercent Complete: 0%
Assigned to: Theodore A. Roth <troth>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 19 Sep 2004 09:10:08 PM UTC, comment #2:

Fixed in both, HEAD and avr-libc-1_0-branch.

Tbanks to Ted for his good analysis of the problem!

Joerg Wunsch <joerg_wunsch>
Project Administrator
Fri 17 Sep 2004 06:53:15 PM UTC, comment #1:

I posted a potential fix to the dev mailing list. If the fix is acceptable, I'll commit it and close out this bug.

Thank you for supplying a concise example demostrating the problem. That made finding the problem trivial.

Theodore A. Roth <troth>In charge of this item.
Fri 17 Sep 2004 03:32:25 AM UTC, 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=%d\n",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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 19 Sep 2004 09:10:08 PM UTCjoerg_wunschStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Fri 17 Sep 2004 06:53:15 PM UTCtrothCategoryNone=>Library
  Assigned toNone=>troth

Back to the top


Powered by Savane 3.1-cleanup1