X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=xutil.c;h=26761d78e8914511a148a5fc2197175907ce2f69;hp=eadd3783f9477735d43cabd84f96c9a53e900184;hb=7b227a6bf7eb409b4353adc430b2545166e0c4cd;hpb=3b8e3ab666a54407f9596a53c66ba8ce623ac91d diff --git a/xutil.c b/xutil.c index eadd3783..26761d78 100644 --- a/xutil.c +++ b/xutil.c @@ -104,10 +104,8 @@ xregcomp (regex_t *preg, const char *regex, int cflags) char *error = xmalloc (error_size); regerror (rerr, preg, error, error_size); - fprintf (stderr, "Internal error compiling regex %s: %s\n", - regex, error); - free (error); - exit (1); + INTERNAL_ERROR ("compiling regex %s: %s\n", + regex, error); } } @@ -122,11 +120,9 @@ xregexec (const regex_t *preg, const char *string, return rerr; for (i = 0; i < nmatch; i++) { - if (pmatch[i].rm_so == -1) { - fprintf (stderr, "Internal error matching regex against %s: Sub-match %d not found\n", - string, i); - exit (1); - } + if (pmatch[i].rm_so == -1) + INTERNAL_ERROR ("matching regex against %s: Sub-match %d not found\n", + string, i); } return 0;