]> git.notmuchmail.org Git - notmuch/blobdiff - xutil.c
notmuch.el: Add final '*' to generated buffer names.
[notmuch] / xutil.c
diff --git a/xutil.c b/xutil.c
index eadd3783f9477735d43cabd84f96c9a53e900184..6fa5eb0ddb49dfb12dcd0cf039d4165cd8f6f7cb 100644 (file)
--- 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);
     }
 }
 
@@ -115,18 +113,17 @@ int
 xregexec (const regex_t *preg, const char *string,
          size_t nmatch, regmatch_t pmatch[], int eflags)
 {
-    int i, rerr;
+    unsigned int i;
+    int rerr;
 
     rerr = regexec (preg, string, nmatch, pmatch, eflags);
     if (rerr)
        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;