Cleanup
No functional changes.
This commit is contained in:
parent
2921eed702
commit
c419946729
31
src/common.c
31
src/common.c
@ -1551,17 +1551,11 @@ regex_compile (const char *regex, int flags, struct error **e)
|
||||
if (!err)
|
||||
return re;
|
||||
|
||||
struct str desc;
|
||||
str_init (&desc);
|
||||
|
||||
size_t required = regerror (err, re, NULL, 0);
|
||||
str_ensure_space (&desc, required);
|
||||
desc.len += regerror (err, re,
|
||||
desc.str + desc.len, desc.alloc - desc.len) - 1;
|
||||
char buf[regerror (err, re, NULL, 0)];
|
||||
regerror (err, re, buf, sizeof buf);
|
||||
|
||||
free (re);
|
||||
error_set (e, "%s: %s", "failed to compile regular expression", desc.str);
|
||||
str_free (&desc);
|
||||
error_set (e, "%s: %s", "failed to compile regular expression", buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1799,17 +1793,7 @@ read_config_file (struct str_map *config, struct error **e)
|
||||
start++;
|
||||
|
||||
char *end = strchr (start, '=');
|
||||
if (!end)
|
||||
{
|
||||
if (*start)
|
||||
{
|
||||
error_set (e, "line %u in config: %s",
|
||||
line_no, "malformed input");
|
||||
errors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (end)
|
||||
{
|
||||
char *value = end + 1;
|
||||
do
|
||||
@ -1818,11 +1802,16 @@ read_config_file (struct str_map *config, struct error **e)
|
||||
|
||||
str_map_set (config, start, xstrdup (value));
|
||||
}
|
||||
else if (*start)
|
||||
{
|
||||
error_set (e, "line %u in config: %s", line_no, "malformed input");
|
||||
errors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
str_free (&line);
|
||||
fclose (fp);
|
||||
|
||||
return !errors;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "siphash.h"
|
||||
|
||||
static uint64_t inline
|
||||
inline static uint64_t
|
||||
u8to64_le (const unsigned char *p)
|
||||
{
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user