From: Andreas Schneider Date: Tue, 8 May 2018 07:31:51 +0000 (+0200) Subject: lib:util: Fix size types in debug.c X-Git-Tag: ldb-1.4.0~124 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=fb6cd9c44ac6fcc9f6abe3b63fc742aeac42969a lib:util: Fix size types in debug.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner --- diff --git a/lib/util/debug.c b/lib/util/debug.c index 2dafd8e1d3a..141f3a595ca 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -480,8 +480,8 @@ static void debug_set_backends(const char *param) static void debug_backends_log(const char *msg, int msg_level) { char msg_no_nl[FORMAT_BUFR_SIZE]; - unsigned i; - int len; + size_t i; + size_t len; /* * Some backends already add an extra newline, so also provide @@ -559,7 +559,7 @@ static const char *default_classname_table[] = { */ static const int debug_class_list_initial[ARRAY_SIZE(default_classname_table)]; -static int debug_num_classes = 0; +static size_t debug_num_classes = 0; int *DEBUGLEVEL_CLASS = discard_const_p(int, debug_class_list_initial); @@ -638,7 +638,7 @@ utility lists registered debug class names's char *debug_list_class_names_and_levels(void) { char *buf = NULL; - int i; + size_t i; /* prepare strings */ for (i = 0; i < debug_num_classes; i++) { buf = talloc_asprintf_append(buf, @@ -659,7 +659,7 @@ char *debug_list_class_names_and_levels(void) static int debug_lookup_classname_int(const char* classname) { - int i; + size_t i; if (!classname) return -1; @@ -749,7 +749,7 @@ static int debug_lookup_classname(const char *classname) static void debug_dump_status(int level) { - int q; + size_t q; DEBUG(level, ("INFO: Current debug levels:\n")); for (q = 0; q < debug_num_classes; q++) { @@ -798,7 +798,7 @@ bool debug_parse_levels(const char *params_str) size_t str_len = strlen(params_str); char str[str_len+1]; char *tok, *saveptr; - int i; + size_t i; /* Just in case */ debug_init();