Back to index

glibc  2.9
Defines | Functions
bug18.c File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include "../test-skeleton.c"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define CHAR   char
#define L(str)   str
#define SSCANF   sscanf
#define TEST_FUNCTION   do_test ()


static int do_test (void)

Define Documentation

#define CHAR   char

Definition at line 6 of file bug18.c.

#define L (   str)    str

Definition at line 7 of file bug18.c.

#define SSCANF   sscanf

Definition at line 8 of file bug18.c.

#define TEST_FUNCTION   do_test ()

Definition at line 47 of file bug18.c.

Function Documentation

static int do_test ( void  ) [static]

Definition at line 13 of file bug18.c.

  printf("setting errno to EINTR\n");
  errno = EINTR;

  printf("checking sscanf\n");

  CHAR str[] = L("7-11");
  int i, j, n;

  i = j = n = 0;
  SSCANF (str, L(" %i - %i %n"), &i, &j, &n);
  printf ("found %i-%i (length=%i)\n", i, j, n);

  int result = 0;
  if (i != 7)
      printf ("i is %d, expected 7\n", i);
      result = 1;
  if (j != 11)
      printf ("j is %d, expected 11\n", j);
      result = 1;
  if (n != 4)
      printf ("n is %d, expected 4\n", j);
      result = 1;

  return result;

Here is the call graph for this function: