Fri 14 Mar 2008 07:30:26 PM UTC, comment #4:
> Will this patch be applied to the 1.4 branch ?
Nope, the 1.4 branch is now officially closed -- well, as
officially as possible. If there were a real "killer"
bug, we might consider another release, but otherwise no
CVS commits happen to that branch.
The scanf() fix is actually not even really a patch but
rather a complete rewrite, so that's for sure no material
for the 1.4 branch anyway even though it also fixes bugs.
|
Fri 14 Mar 2008 05:58:00 PM UTC, original submission:
The following code illustrates the bug.
char
s1[5],
s2[5];
int
result;
s1[0] = 0;
s2[0] = 0;
result = sscanf_P( ",ABCD,EFGH,", PSTR( ",%4s,%4s," ), &s1, &s2 );
printf_P( PSTR( "%d %s %s\r\n" ), result, s1, s2 );
s1[0] = 0;
s2[0] = 0;
result = sscanf_P( ",ABCD,EFGH,", PSTR( ",%3s,%3s," ), &s1, &s2 );
printf_P( PSTR( "%d %s %s\r\n" ), result, s1, s2 );
results from executing this code.
1 ABCD
2 ABC EFG
Had a quick look at the code and I believe the problem is that when the loop is exited in the case statement for the 's' one extra character has been removed from the stream;
Best regards
Brent
|