1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +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:
Martin Schwenke 2019-06-02 14:05:28 +10:00 committed by Amitay Isaacs
parent 5b9456b70b
commit 2b3150db94
2 changed files with 8 additions and 8 deletions
ctdb/common

View File

@ -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,11 +253,11 @@ static int debug_level_to_priority(int level)
};
int priority;
if( level >= ARRAY_SIZE(priority_map) || level < 0)
if ((size_t)level >= ARRAY_SIZE(priority_map) || level < 0) {
priority = LOG_DEBUG;
else
} else {
priority = priority_map[level];
}
return priority;
}

View File

@ -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;
}