source: branches/libc-0.6/src/libctests/glibc/posix/bug-regex15.c

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 593 bytes
Line 
1/* Test for memory/CPU leak in regcomp. */
2
3#include <error.h>
4#include <sys/types.h>
5#include <regex.h>
6#include <stdio.h>
7#include <stdlib.h>
8
9#define TEST_DATA_LIMIT (32 << 20)
10
11static int do_test (void);
12#define TEST_FUNCTION do_test ()
13#include "../test-skeleton.c"
14
15static int
16do_test (void)
17{
18 regex_t re;
19 int reerr;
20
21 reerr = regcomp (&re, "^6?3?[25]?5?[14]*[25]*[69]*+[58]*87?4?$",
22 REG_EXTENDED | REG_NOSUB);
23 if (reerr != 0)
24 {
25 char buf[100];
26 regerror (reerr, &re, buf, sizeof buf);
27 printf ("regerror %s\n", buf);
28 return 1;
29 }
30
31 return 0;
32}
Note: See TracBrowser for help on using the repository browser.