1
/* bug #22800: sprintf() expands a 128char string parameter incorrectly
2
$Id: bug-22800.c,v 1.1.2.2 2008/04/03 11:19:52 dmix Exp $
4
This bug is marked as INVALID. It is take place with avr-libc 1.4 only,
5
which is not supported now. Avr-libc 1.6 is correct.
12
# define strcmp_P strcmp
15
# include <avr/pgmspace.h>
19
char buffer[210], string[200];
26
/* This is the bug report code. */
27
for (i = 0; i < 129; i++)
29
sprintf (buffer, "%s%s", string, tmp);
31
if (strcmp_P (buffer, PSTR ("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 32*B */
32
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 32*B */
33
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 32*B */
34
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" /* 32*B */
40
#if !defined(__AVR__) || (RAMEND >= 0x45F)
41
/* Check the size > 255. */
46
memset (s, 'A', sizeof(s));
48
memset (t, 'B', sizeof(t));
51
if (strcmp (s, t)) return __LINE__;