author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 11 Dec 2015 22:01:06 +0000 (23:01 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 11 Dec 2015 22:01:06 +0000 (23:01 +0100) |
1 | 2 | |||
---|---|---|---|---|
src/daemon/utils_ignorelist.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/daemon/utils_ignorelist.c
index a8ca7dbb7f3aecbb2c6ea90519c2583aae0c30f5,6b5e894f8e83e75998ae4c6cedc27ea45451e2bf..60a8c2733f3786703c9d52ee297462af86a4582b
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)