re = malloc (sizeof (*re));
if (re == NULL)
{
- ERROR ("utils_ignorelist: malloc failed");
+ ERROR ("ignorelist_append_regex: malloc failed.");
- return ENOMEM;
+ return (ENOMEM);
}
memset (re, 0, sizeof (*re));
- /* compile regex */
- status = regcomp (re, entry, REG_EXTENDED);
+ status = regcomp (re, re_str, REG_EXTENDED);
if (status != 0)
{
- char errbuf[1024] = "";
- regerror (status, re, errbuf, sizeof (errbuf));
+ char errbuf[1024];
-
+ (void) regerror (status, re, errbuf, sizeof (errbuf));
- ERROR ("ignorelist_append_regex: Compiling regular expression \"%s\" failed: %s", entry, errbuf);
+ ERROR ("utils_ignorelist: regcomp failed: %s", errbuf);
- regfree (re);
++ ERROR ("ignorelist_append_regex: Compiling regular expression \"%s\" failed: %s", re_str, errbuf);
sfree (re);
- return status;
+ return (status);
}
- /* create new entry */
- item = malloc (sizeof (*item));
- if (item == NULL)
+ entry = malloc (sizeof (*entry));
+ if (entry == NULL)
{
- ERROR ("utils_ignorelist: malloc failed");
+ ERROR ("ignorelist_append_regex: malloc failed.");
regfree (re);
sfree (re);
- return ENOMEM;
+ return (ENOMEM);
}
- memset (item, 0, sizeof (*item));
- item->rmatch = re;
-
- /* append new entry */
- ignorelist_append (il, item);
+ memset (entry, 0, sizeof (*entry));
+ entry->rmatch = re;
+ ignorelist_append (il, entry);
return (0);
-} /* int ignorelist_append_regex(ignorelist_t *il, const char *entry) */
+} /* int ignorelist_append_regex */
#endif
static int ignorelist_append_string(ignorelist_t *il, const char *entry)