mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
cppcheck: fix variable scoping
[src/dhcpd-pools.c:68]: (style) The scope of the variable 'c' can be reduced. [src/getdata.c:210]: (style) The scope of the variable 'c' can be reduced. [src/hash.c:102]: (style) The scope of the variable 'l' can be reduced. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
23aae87356
commit
c3e492165c
3 changed files with 5 additions and 3 deletions
|
|
@ -65,7 +65,7 @@
|
|||
* alarming. */
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i, c, sorts = 0;
|
||||
int i, sorts = 0;
|
||||
int option_index = 0;
|
||||
char const *tmp;
|
||||
struct range_t *tmp_ranges;
|
||||
|
|
@ -124,6 +124,7 @@ int main(int argc, char **argv)
|
|||
|
||||
/* Parse command line options */
|
||||
while (1) {
|
||||
int c;
|
||||
c = getopt_long(argc, argv, "c:l:f:o:s:rL:vh",
|
||||
long_options, &option_index);
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
bool newclause = true, comment = false;
|
||||
int quote = 0, braces = 0, argument = ITS_NOTHING_INTERESTING;
|
||||
size_t i = 0;
|
||||
char *word, c;
|
||||
char *word;
|
||||
int braces_shared = 1000;
|
||||
union ipaddr_t addr;
|
||||
struct range_t *range_p;
|
||||
|
|
@ -239,6 +239,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
|
||||
/* Very hairy stuff begins. */
|
||||
while (unlikely(!feof(dhcpd_config))) {
|
||||
char c;
|
||||
c = fgetc(dhcpd_config);
|
||||
/* Certain characters are magical */
|
||||
switch (c) {
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ void delete_all_leases(void)
|
|||
#else
|
||||
void delete_all_leases(void)
|
||||
{
|
||||
struct leases_t *l;
|
||||
while (leases) {
|
||||
struct leases_t *l;
|
||||
l = leases;
|
||||
free(l->ethernet);
|
||||
HASH_DEL(leases, l); /* leases advances to next on delete */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue