mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-common: Fix signed/unsigned comparisons by casting
In one case, given triviality of change, add missing braces and fix whitespace. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
5b9456b70b
commit
2b3150db94
@ -63,7 +63,7 @@ bool debug_level_parse(const char *log_string, int *log_level)
|
||||
if (isdigit(log_string[0])) {
|
||||
int level = atoi(log_string);
|
||||
|
||||
if (level >= 0 && level < ARRAY_SIZE(log_string_map)) {
|
||||
if (level >= 0 && (size_t)level < ARRAY_SIZE(log_string_map)) {
|
||||
*log_level = level;
|
||||
return true;
|
||||
}
|
||||
@ -253,12 +253,12 @@ static int debug_level_to_priority(int level)
|
||||
};
|
||||
int priority;
|
||||
|
||||
if( level >= ARRAY_SIZE(priority_map) || level < 0)
|
||||
priority = LOG_DEBUG;
|
||||
else
|
||||
priority = priority_map[level];
|
||||
|
||||
return priority;
|
||||
if ((size_t)level >= ARRAY_SIZE(priority_map) || level < 0) {
|
||||
priority = LOG_DEBUG;
|
||||
} else {
|
||||
priority = priority_map[level];
|
||||
}
|
||||
return priority;
|
||||
}
|
||||
|
||||
struct syslog_log_state {
|
||||
|
@ -89,7 +89,7 @@ static bool path_construct(char *path, const char *subdir)
|
||||
subdir);
|
||||
}
|
||||
|
||||
if (len >= sizeof(p)) {
|
||||
if ((size_t)len >= sizeof(p)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user