No functional changes.
This commit is contained in:
Přemysl Eric Janouch 2014-07-15 23:12:28 +02:00
parent 2921eed702
commit c419946729
2 changed files with 11 additions and 22 deletions

View File

@ -1551,17 +1551,11 @@ regex_compile (const char *regex, int flags, struct error **e)
if (!err) if (!err)
return re; return re;
struct str desc; char buf[regerror (err, re, NULL, 0)];
str_init (&desc); regerror (err, re, buf, sizeof buf);
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;
free (re); free (re);
error_set (e, "%s: %s", "failed to compile regular expression", desc.str); error_set (e, "%s: %s", "failed to compile regular expression", buf);
str_free (&desc);
return NULL; return NULL;
} }
@ -1799,17 +1793,7 @@ read_config_file (struct str_map *config, struct error **e)
start++; start++;
char *end = strchr (start, '='); char *end = strchr (start, '=');
if (!end) if (end)
{
if (*start)
{
error_set (e, "line %u in config: %s",
line_no, "malformed input");
errors = true;
break;
}
}
else
{ {
char *value = end + 1; char *value = end + 1;
do do
@ -1818,11 +1802,16 @@ read_config_file (struct str_map *config, struct error **e)
str_map_set (config, start, xstrdup (value)); 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); str_free (&line);
fclose (fp); fclose (fp);
return !errors; return !errors;
} }

View File

@ -9,7 +9,7 @@
#include "siphash.h" #include "siphash.h"
static uint64_t inline inline static uint64_t
u8to64_le (const unsigned char *p) u8to64_le (const unsigned char *p)
{ {
return return