lib:util: Fix size types in debug.c
authorAndreas Schneider <asn@samba.org>
Tue, 8 May 2018 07:31:51 +0000 (09:31 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 17 May 2018 15:30:09 +0000 (17:30 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
lib/util/debug.c

index 2dafd8e1d3a15d2a6613c3ef7dfafd0e9150d118..141f3a595cada3fe0e405917c9b2029a423ea852 100644 (file)
@@ -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();