summaryrefslogtreecommitdiff
path: root/stdio-common/bug23.c
blob: dcc5428078a4d6a68eed08956fedc5ce6db70aa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <string.h>

static char buf[32768];
static const char expected[] = "\
\n\
a\n\
abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";

static int
do_test (void)
{
  snprintf (buf, sizeof (buf),
	    "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
	    "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
	    "a", "b", "c", "d", 5);
  return strcmp (buf, expected) != 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"