mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
fix couple compiler warnings
src/getdata.c:248:22: warning: 'range_p' may be used uninitialized in this function [-Wmaybe-uninitialized] src/other.c:383:1: warning: control reaches end of non-void function [-Wreturn-type] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
535dfc4fc2
commit
c30c122027
2 changed files with 5 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
char *word;
|
||||
int braces_shared = 1000;
|
||||
union ipaddr_t addr;
|
||||
struct range_t *range_p;
|
||||
struct range_t *range_p = NULL;
|
||||
|
||||
word = xmalloc(sizeof(char) * MAXLEN);
|
||||
if (is_include)
|
||||
|
|
@ -245,6 +245,9 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
c = ' ';
|
||||
break;
|
||||
} else if (argument == ITS_A_RANGE_SECOND_IP && i == 0) {
|
||||
if (!range_p) {
|
||||
error(EXIT_FAILURE, 0, "parse_config: range_p uninitialized: please report a bug");
|
||||
}
|
||||
range_p->last_ip = range_p->first_ip;
|
||||
goto newrange;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ double strtod_or_err(const char *restrict str, const char *restrict errmesg)
|
|||
return num;
|
||||
err:
|
||||
error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Reverse range.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue