Blame stdio-common/bug6.c

Packit 6c4009
#include <stdio.h>
Packit 6c4009
Packit 6c4009
int
Packit 6c4009
main (void)
Packit 6c4009
{
Packit 6c4009
  char buf[80];
Packit 6c4009
  int i;
Packit 6c4009
  int lost = 0;
Packit 6c4009
Packit 6c4009
  scanf ("%2s", buf);
Packit 6c4009
  lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0');
Packit 6c4009
  if (lost)
Packit 6c4009
    puts ("test of %2s failed.");
Packit 6c4009
  scanf (" ");
Packit 6c4009
  scanf ("%d", &i);
Packit 6c4009
  lost |= (i != 1234);
Packit 6c4009
  if (lost)
Packit 6c4009
    puts ("test of %d failed.");
Packit 6c4009
  scanf ("%c", buf);
Packit 6c4009
  lost |= (buf[0] != 'L');
Packit 6c4009
  if (lost)
Packit 6c4009
    puts ("test of %c failed.\n");
Packit 6c4009
Packit 6c4009
  puts (lost ? "Test FAILED!" : "Test succeeded.");
Packit 6c4009
  return lost;
Packit 6c4009
}