mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
getdata: do not mix boolean and int data types [cppcheck]
[src/getdata.c:307]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:324]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:340]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:362]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:366]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:371]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:372]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 [src/getdata.c:385]: (warning) Comparison of a boolean with integer that is neither 1 nor 0 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
c5b12e4368
commit
97e5b59b78
1 changed files with 7 additions and 7 deletions
|
|
@ -244,8 +244,8 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
struct shared_network_t *restrict shared_p)
|
||||
{
|
||||
FILE *dhcpd_config;
|
||||
int newclause = true, argument = false, comment =
|
||||
false, braces = 0, quote = false;
|
||||
bool newclause = true, comment = false;
|
||||
int quote = 0, braces = 0, argument = 0;
|
||||
size_t i = 0;
|
||||
char *word, c;
|
||||
int braces_shared = 1000;
|
||||
|
|
@ -304,7 +304,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
break;
|
||||
case ';':
|
||||
/* Quoted colon does not mean new clause */
|
||||
if (quote == true) {
|
||||
if (0 < quote) {
|
||||
break;
|
||||
}
|
||||
if (comment == false && argument != 2 && argument != 4) {
|
||||
|
|
@ -321,10 +321,10 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
}
|
||||
continue;
|
||||
case '{':
|
||||
if (quote == true) {
|
||||
if (0 < quote) {
|
||||
break;
|
||||
}
|
||||
if (comment == false) {
|
||||
if (comment == 0) {
|
||||
braces++;
|
||||
}
|
||||
/* i == 0 detects word that ends to brace like:
|
||||
|
|
@ -337,7 +337,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
break;
|
||||
}
|
||||
case '}':
|
||||
if (quote == true) {
|
||||
if (0 < quote) {
|
||||
break;
|
||||
}
|
||||
if (comment == false) {
|
||||
|
|
@ -369,7 +369,7 @@ void parse_config(int is_include, const char *restrict config_file,
|
|||
}
|
||||
/* Save to word which clause this is. */
|
||||
if ((newclause == true || argument != 0)
|
||||
&& (!isspace(c) || quote == true)) {
|
||||
&& (!isspace(c) || 0 < quote)) {
|
||||
word[i] = c;
|
||||
i++;
|
||||
/* Long word which is almost causing overflow. None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue