char **regexes;
char *buffer;
char *regex;
- unsigned int nr;
- unsigned int i;
int compression;
long size;
}
regexes = GNUNET_REGEX_read_from_file (argv[1]);
+ if (NULL == regexes)
+ {
+ usage();
+ return 2;
+ }
buffer = GNUNET_REGEX_combine (regexes);
GNUNET_asprintf (®ex, "GNVPN-0001-PAD(%s)(0|1)*", buffer);
size = strlen (regex);
-
- // fprintf (stderr, "Combined regex:\n%s\n", regex);
+
+ // fprintf (stderr, "Combined regex (%ld bytes):\n%s\n", size, regex);
// return 0;
compression = atoi (argv[2]);
dfa = GNUNET_REGEX_construct_dfa (regex, size, compression);
GNUNET_REGEX_automaton_destroy (dfa);
GNUNET_free (buffer);
- for (i=0;i<nr;i++)
- GNUNET_free_non_null (regexes[i]);
- GNUNET_array_grow (regexes, nr, 0);
+ GNUNET_REGEX_free_from_file (regexes);
return 0;
}