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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  Lars Jonsson <lajon>
Submitted:  Sun 21 Oct 2007 10:22:48 PM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  5 - Normal Item Group:  libc code
Status:  Duplicate Assigned to:  None
Percent Complete:  0% Open/Closed:  Closed
Release:  None Fixed Release:  None

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>
Group 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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-22 arcanum StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code