bugAVR C Runtime Library - Bugs: bug #21382, vscanf problem with %s when a...

 
 

bug #21382: vscanf problem with %s when a width is given

Submitted by:  Lars Jonsson <lajon>
Submitted on:  Sun 21 Oct 2007 10:22:48 PM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 5 - NormalItem Group: libc code
Status: DuplicatePercent Complete: 0%
Assigned to: NoneOpen/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 22 Oct 2007 07:04:07 AM UTC, comment #2:

Ok, good that is is known but I don't really get the concept of private bugs.

Lars Jonsson <lajon>
Mon 22 Oct 2007 12:21:16 AM UTC, comment #1:

This is a duplicate of bug #19079.

Eric Weddington <arcanum>
Project Administrator
Sun 21 Oct 2007 10:22:48 PM UTC, original submission:

Looks like it consumes a character too much during a %s scan when a width is given. In the example below the ',' can not be matched and res will be 0 (and foo is not assigned).

#include <stdio.h>
int parse_test(const char * string)
{
volatile char foo = 0;
int res = sscanf(string, "%*6s,%c", &foo);
printf("%d %c\n", res, foo);
return res == 1 && foo == 'A';
}

int main(int argc, char **argv)
{
parse_test("$GPRMB,A");
}

Lars Jonsson <lajon>

 

(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

 

Carbon-Copy List
  • -unavailable- added by arcanum (Posted a comment)
  • -unavailable- added by lajon (Submitted the item)
  •  

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

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Oct 2007 12:21:16 AM UTCarcanumStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1